]> git.baikalelectronics.ru Git - kernel.git/commit
mm/debug.c: PageAnon() is true for PageKsm() pages
authorRalph Campbell <rcampbell@nvidia.com>
Sat, 16 Nov 2019 01:35:07 +0000 (17:35 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Nov 2019 02:34:00 +0000 (18:34 -0800)
commite7371a4bf5eb09691a4a07f0d66fc51de1556939
tree0d4ae934e93fb95bf1f25a8e5af6587bb6e1fbc4
parente9971c52ba0709ea67231dcd75805b7b5a481ead
mm/debug.c: PageAnon() is true for PageKsm() pages

PageAnon() and PageKsm() use the low two bits of the page->mapping
pointer to indicate the page type.  PageAnon() only checks the LSB while
PageKsm() checks the least significant 2 bits are equal to 3.

Therefore, PageAnon() is true for KSM pages.  __dump_page() incorrectly
will never print "ksm" because it checks PageAnon() first.  Fix this by
checking PageKsm() first.

Link: http://lkml.kernel.org/r/20191113000651.20677-1-rcampbell@nvidia.com
Fixes: 3b0d2bf40c0a ("mm: print more information about mapping in __dump_page")
Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/debug.c