+ mm-debug-pageanon-is-true-for-pageksm-pages.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/debug.c: PageAnon() is true for PageKsm() pages
has been added to the -mm tree.  Its filename is
     mm-debug-pageanon-is-true-for-pageksm-pages.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-debug-pageanon-is-true-for-pageksm-pages.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-debug-pageanon-is-true-for-pageksm-pages.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Ralph Campbell <rcampbell@xxxxxxxxxx>
Subject: 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@xxxxxxxxxx
Signed-off-by: Ralph Campbell <rcampbell@xxxxxxxxxx>
Cc: Jerome Glisse <jglisse@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/debug.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/mm/debug.c~mm-debug-pageanon-is-true-for-pageksm-pages
+++ a/mm/debug.c
@@ -77,10 +77,10 @@ void __dump_page(struct page *page, cons
 		pr_warn("page:%px refcount:%d mapcount:%d mapping:%px index:%#lx\n",
 			page, page_ref_count(page), mapcount,
 			page->mapping, page_to_pgoff(page));
-	if (PageAnon(page))
-		pr_warn("anon flags: %#lx(%pGp)\n", page->flags, &page->flags);
-	else if (PageKsm(page))
+	if (PageKsm(page))
 		pr_warn("ksm flags: %#lx(%pGp)\n", page->flags, &page->flags);
+	else if (PageAnon(page))
+		pr_warn("anon flags: %#lx(%pGp)\n", page->flags, &page->flags);
 	else if (mapping) {
 		if (mapping->host && mapping->host->i_dentry.first) {
 			struct dentry *dentry;
_

Patches currently in -mm which might be from rcampbell@xxxxxxxxxx are

mm-debug-__dump_page-prints-an-extra-line.patch
mm-debug-pageanon-is-true-for-pageksm-pages.patch
mm-thp-make-set_huge_zero_page-return-void.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux