All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/debug:
@ 2019-11-11 22:49 Ralph Campbell
  2019-11-11 23:02 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Ralph Campbell @ 2019-11-11 22:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, Ralph Campbell

When dumping struct page information, __dump_page() prints the page type
with a trailing blank followed by the page flags on a separate line:

anon
flags: 0x100000000090034(uptodate|lru|active|head|swapbacked)

Fix this by using pr_cont() instead of pr_warn() to get a single line:

anon flags: 0x100000000090034(uptodate|lru|active|head|swapbacked)

Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
---
 mm/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/debug.c b/mm/debug.c
index 8345bb6e4769..752c78721ea0 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -87,7 +87,7 @@ void __dump_page(struct page *page, const char *reason)
 	}
 	BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1);
 
-	pr_warn("flags: %#lx(%pGp)\n", page->flags, &page->flags);
+	pr_cont("flags: %#lx(%pGp)\n", page->flags, &page->flags);
 
 hex_only:
 	print_hex_dump(KERN_WARNING, "raw: ", DUMP_PREFIX_NONE, 32,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/debug:
  2019-11-11 22:49 [PATCH] mm/debug: Ralph Campbell
@ 2019-11-11 23:02 ` Andrew Morton
  2019-11-11 23:41   ` Ralph Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2019-11-11 23:02 UTC (permalink / raw)
  To: Ralph Campbell; +Cc: linux-mm, linux-kernel

On Mon, 11 Nov 2019 14:49:35 -0800 Ralph Campbell <rcampbell@nvidia.com> wrote:

> When dumping struct page information, __dump_page() prints the page type
> with a trailing blank followed by the page flags on a separate line:
> 
> anon
> flags: 0x100000000090034(uptodate|lru|active|head|swapbacked)
> 
> Fix this by using pr_cont() instead of pr_warn() to get a single line:
> 
> anon flags: 0x100000000090034(uptodate|lru|active|head|swapbacked)
> 
> Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
> ---
>  mm/debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/debug.c b/mm/debug.c
> index 8345bb6e4769..752c78721ea0 100644
> --- a/mm/debug.c
> +++ b/mm/debug.c
> @@ -87,7 +87,7 @@ void __dump_page(struct page *page, const char *reason)
>  	}
>  	BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1);
>  
> -	pr_warn("flags: %#lx(%pGp)\n", page->flags, &page->flags);
> +	pr_cont("flags: %#lx(%pGp)\n", page->flags, &page->flags);
>  
>  hex_only:
>  	print_hex_dump(KERN_WARNING, "raw: ", DUMP_PREFIX_NONE, 32,

This is the case if PageAnon || PageKsm || mapping.  If it is, say,
PageSlab then we effectively do

	pr_warn("stuff-with-no-newline");
	pr_cont("\n");
	pr_cont("flags: ...\n");

does this work OK?  what facility level will that "flags: " line get?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/debug:
  2019-11-11 23:02 ` Andrew Morton
@ 2019-11-11 23:41   ` Ralph Campbell
  0 siblings, 0 replies; 3+ messages in thread
From: Ralph Campbell @ 2019-11-11 23:41 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel


On 11/11/19 3:02 PM, Andrew Morton wrote:
> On Mon, 11 Nov 2019 14:49:35 -0800 Ralph Campbell <rcampbell@nvidia.com> wrote:
> 
>> When dumping struct page information, __dump_page() prints the page type
>> with a trailing blank followed by the page flags on a separate line:
>>
>> anon
>> flags: 0x100000000090034(uptodate|lru|active|head|swapbacked)
>>
>> Fix this by using pr_cont() instead of pr_warn() to get a single line:
>>
>> anon flags: 0x100000000090034(uptodate|lru|active|head|swapbacked)
>>
>> Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
>> ---
>>   mm/debug.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/debug.c b/mm/debug.c
>> index 8345bb6e4769..752c78721ea0 100644
>> --- a/mm/debug.c
>> +++ b/mm/debug.c
>> @@ -87,7 +87,7 @@ void __dump_page(struct page *page, const char *reason)
>>   	}
>>   	BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1);
>>   
>> -	pr_warn("flags: %#lx(%pGp)\n", page->flags, &page->flags);
>> +	pr_cont("flags: %#lx(%pGp)\n", page->flags, &page->flags);
>>   
>>   hex_only:
>>   	print_hex_dump(KERN_WARNING, "raw: ", DUMP_PREFIX_NONE, 32,
> 
> This is the case if PageAnon || PageKsm || mapping.  If it is, say,
> PageSlab then we effectively do
> 
> 	pr_warn("stuff-with-no-newline");
> 	pr_cont("\n");
> 	pr_cont("flags: ...\n");
> 
> does this work OK?  what facility level will that "flags: " line get?

I don't see a "\n" in the "mapping" case but the
	if (mapping->host && mapping->host->i_dentry.first)
		pr_warn("name:\"%pd\" ", dentry)
would end up on a new line.
Ugh. I guess the dentry name could be fairly long.
I guess I will just convert to using "\n".

AFAIK, there is no locking between pr_warn() and pr_cont() so the latter
could get appended to any facility level. But that isn't a problem I
plan to fix.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-11 23:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 22:49 [PATCH] mm/debug: Ralph Campbell
2019-11-11 23:02 ` Andrew Morton
2019-11-11 23:41   ` Ralph Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.