Skip to content

Commit 91f5345

Browse files
Matthew Wilcox (Oracle)torvalds
authored andcommitted
mm/debug: improve memcg debugging
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>
1 parent 457c82c commit 91f5345

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎mm/debug.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ void __dump_page(struct page *page, const char *reason)
110110
head_compound_mapcount(head));
111111
}
112112
}
113+
114+
#ifdef CONFIG_MEMCG
115+
if (head->memcg_data)
116+
pr_warn("memcg:%lx\n", head->memcg_data);
117+
#endif
113118
if (PageKsm(page))
114119
type = "ksm ";
115120
else if (PageAnon(page))
@@ -180,11 +185,6 @@ void __dump_page(struct page *page, const char *reason)
180185

181186
if (reason)
182187
pr_warn("page dumped because: %s\n", reason);
183-
184-
#ifdef CONFIG_MEMCG
185-
if (!page_poisoned && page->memcg_data)
186-
pr_warn("pages's memcg:%lx\n", page->memcg_data);
187-
#endif
188188
}
189189

190190
void dump_page(struct page *page, const char *reason)

0 commit comments

Comments
 (0)