mm: avoid endless recursion in dump_page()
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Sat, 10 Sep 2016 10:34:00 +0000 (20:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sat, 10 Sep 2016 10:34:00 +0000 (20:34 +1000)
commit72b7f562f0c081f2a0e4c4c6feccc6be5b473645
tree94c12c4e7863b46ff9fdef0309efe9bde2b5d499
parent617127d2edc23be30718c40b8c5b39b87c9fe0e4
mm: avoid endless recursion in dump_page()

dump_page() uses page_mapcount() to get mapcount of the page.
page_mapcount() has VM_BUG_ON_PAGE(PageSlab(page)) as mapcount doesn't
make sense for slab pages and the field in struct page used for other
information.

It leads to recursion if dump_page() called for slub page and DEBUG_VM
is enabled:

dump_page() -> page_mapcount() -> VM_BUG_ON_PAGE() -> dump_page -> ...

Let's avoid calling page_mapcount() for slab pages in dump_page().

Link: http://lkml.kernel.org/r/20160908082137.131076-1-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/debug.c
This page took 0.025413 seconds and 5 git commands to generate.