Skip to content

Commit

Permalink
mm/debug: improve memcg debugging
Browse files Browse the repository at this point in the history
The memcg_data is only valid on the head page, not the tail pages.  Change
the format and location of the printout within the dump to match the other
parts of struct page better.

Link: https://lkml.kernel.org/r/20210114190200.1894484-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Matthew Wilcox (Oracle) authored and torvalds committed Feb 24, 2021
1 parent 457c82c commit 91f5345
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mm/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ void __dump_page(struct page *page, const char *reason)
head_compound_mapcount(head));
}
}

#ifdef CONFIG_MEMCG
if (head->memcg_data)
pr_warn("memcg:%lx\n", head->memcg_data);
#endif
if (PageKsm(page))
type = "ksm ";
else if (PageAnon(page))
Expand Down Expand Up @@ -180,11 +185,6 @@ void __dump_page(struct page *page, const char *reason)

if (reason)
pr_warn("page dumped because: %s\n", reason);

#ifdef CONFIG_MEMCG
if (!page_poisoned && page->memcg_data)
pr_warn("pages's memcg:%lx\n", page->memcg_data);
#endif
}

void dump_page(struct page *page, const char *reason)
Expand Down

0 comments on commit 91f5345

Please sign in to comment.