Re: [PATCH 1/3] mm: Print head flags in dump_page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-06-29 08:19, Matthew Wilcox (Oracle) wrote:
Tail page flags contain very little useful information.  Print the head
page's flags instead (even though PageHead is a little misleading).

You are right about the tail page. And the raw output provides the tail
page flags, in case someone *really* needs to dig into tail page problems,
so that's all good.

However, I just gave this a spin, and seeing the "|head" in the list for
my "tail page: dump_page test" is also slightly misleading for me, too.

Sure, one can eventually work through it and conclude "my dump_page output
is misleading", but I think a small tweak would avoid that:


Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
  mm/debug.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/debug.c b/mm/debug.c
index 4f376514744d..44d843b3b07c 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -163,7 +163,7 @@ void __dump_page(struct page *page, const char *reason)
  out_mapping:
  	BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1);
- pr_warn("%sflags: %#lx(%pGp)%s\n", type, page->flags, &page->flags,
+	pr_warn("%sflags: %#lx(%pGp)%s\n", type, head->flags, &head->flags,
  		page_cma ? " CMA" : "");


Perhaps just adding "head " to the above will clear it all up:

diff --git a/mm/debug.c b/mm/debug.c
index fcf3a16902b2..b7ac8af71940 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -165,7 +165,7 @@ void __dump_page(struct page *page, const char *reason)
 out_mapping:
 	BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1);

-	pr_warn("%sflags: %#lx(%pGp)%s\n", type, head->flags, &head->flags,
+	pr_warn("head %sflags: %#lx(%pGp)%s\n", type, head->flags, &head->flags,
 		page_cma ? " CMA" : "");

 hex_only:


Sample output:

[ 62.064271] page:000000001c8f0c3e refcount:513 mapcount:1 mapping:0000000000000000 index:0x11 head:00000000ba9ccef2 order:9 compound_mapcount:1 compound_pincount:512
[   62.078432] head anon flags: 0x17ffe000001000e(referenced|uptodate|dirty|head)
[   62.088454] raw: 017ffe0000000000 ffffea00209e8001 ffffea00209e8448 dead000000000400
[   62.095356] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   62.102289] head: 017ffe000001000e ffffffff83649ca0 ffffea00209e0008 ffff88889663c001
[   62.109286] head: 0000000000000000 0000000000000000 00000201ffffffff 0000000000000000
[   62.116301] page dumped because: gup_benchmark: tail page: dump_page test



thanks,
--
John Hubbard
NVIDIA




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux