mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-pagemap-fix-soft-dirty-marking-for-pmd-migration-entry.patch added to -mm tree
@ 2017-10-17 22:35 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-10-17 22:35 UTC (permalink / raw)
  To: ying.huang, arnd, dancol, hughd, jglisse, khandual,
	kirill.shutemov, mhocko, n-horiguchi, rientjes, zi.yan,
	mm-commits


The patch titled
     Subject: mm, /proc/pid/pagemap: fix soft dirty marking for PMD migration entry
has been added to the -mm tree.  Its filename is
     mm-pagemap-fix-soft-dirty-marking-for-pmd-migration-entry.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-pagemap-fix-soft-dirty-marking-for-pmd-migration-entry.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-pagemap-fix-soft-dirty-marking-for-pmd-migration-entry.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/SubmitChecklist when testing your code ***

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

------------------------------------------------------
From: Huang Ying <ying.huang@intel.com>
Subject: mm, /proc/pid/pagemap: fix soft dirty marking for PMD migration entry

Now, when the page table is walked in the implementation of
/proc/<pid>/pagemap, pmd_soft_dirty() is used for both the PMD huge page
map and the PMD migration entries.  That is wrong, pmd_swp_soft_dirty()
should be used for the PMD migration entries instead because the different
page table entry flag is used.

As a result, /proc/pid/pagemap may report incorrect soft dirty information
for PMD migration entries.

Link: http://lkml.kernel.org/r/20171017081818.31795-1-ying.huang@intel.com
Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: Daniel Colascione <dancol@google.com>
Cc: Zi Yan <zi.yan@cs.rutgers.edu>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/proc/task_mmu.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff -puN fs/proc/task_mmu.c~mm-pagemap-fix-soft-dirty-marking-for-pmd-migration-entry fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c~mm-pagemap-fix-soft-dirty-marking-for-pmd-migration-entry
+++ a/fs/proc/task_mmu.c
@@ -1310,13 +1310,15 @@ static int pagemap_pmd_range(pmd_t *pmdp
 		pmd_t pmd = *pmdp;
 		struct page *page = NULL;
 
-		if ((vma->vm_flags & VM_SOFTDIRTY) || pmd_soft_dirty(pmd))
+		if (vma->vm_flags & VM_SOFTDIRTY)
 			flags |= PM_SOFT_DIRTY;
 
 		if (pmd_present(pmd)) {
 			page = pmd_page(pmd);
 
 			flags |= PM_PRESENT;
+			if (pmd_soft_dirty(pmd))
+				flags |= PM_SOFT_DIRTY;
 			if (pm->show_pfn)
 				frame = pmd_pfn(pmd) +
 					((addr & ~PMD_MASK) >> PAGE_SHIFT);
@@ -1328,6 +1330,8 @@ static int pagemap_pmd_range(pmd_t *pmdp
 			frame = swp_type(entry) |
 				(swp_offset(entry) << MAX_SWAPFILES_SHIFT);
 			flags |= PM_SWAP;
+			if (pmd_swp_soft_dirty(pmd))
+				flags |= PM_SOFT_DIRTY;
 			VM_BUG_ON(!is_pmd_migration_entry(pmd));
 			page = migration_entry_to_page(entry);
 		}
_

Patches currently in -mm which might be from ying.huang@intel.com are

mm-pagemap-fix-soft-dirty-marking-for-pmd-migration-entry.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-17 22:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 22:35 + mm-pagemap-fix-soft-dirty-marking-for-pmd-migration-entry.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).