Skip to content

Commit

Permalink
mm: clarify why we avoid page_mapcount() for slab pages in dump_page()
Browse files Browse the repository at this point in the history
Let's add comment on why we skip page_mapcount() for sl[aou]b pages.

Link: http://lkml.kernel.org/r/20160922105532.GB24593@node
Signed-off-by: Kirill A. Shutemov <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kiryl authored and torvalds committed Oct 8, 2016
1 parent 8f26e0b commit 9996f05
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mm/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ const struct trace_print_flags vmaflag_names[] = {

void __dump_page(struct page *page, const char *reason)
{
/*
* Avoid VM_BUG_ON() in page_mapcount().
* page->_mapcount space in struct page is used by sl[aou]b pages to
* encode own info.
*/
int mapcount = PageSlab(page) ? 0 : page_mapcount(page);

pr_emerg("page:%p count:%d mapcount:%d mapping:%p index:%#lx",
Expand Down

0 comments on commit 9996f05

Please sign in to comment.