mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + thp-fix-madv_dontneed-vs-madv_free-race.patch added to -mm tree
@ 2017-03-03 22:30 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-03-03 22:30 UTC (permalink / raw)
  To: kirill.shutemov, aarcange, minchan, mm-commits


The patch titled
     Subject: thp: fix MADV_DONTNEED vs. MADV_FREE race
has been added to the -mm tree.  Its filename is
     thp-fix-madv_dontneed-vs-madv_free-race.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/thp-fix-madv_dontneed-vs-madv_free-race.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/thp-fix-madv_dontneed-vs-madv_free-race.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: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: thp: fix MADV_DONTNEED vs. MADV_FREE race

Basically the same race as with numa balancing in change_huge_pmd(), but
a bit simpler to mitigate: we don't need to preserve dirty/young flags
here due to MADV_FREE functionality.

See "thp: fix MADV_DONTNEED vs. numa balancing race" for more details.

Link: http://lkml.kernel.org/r/20170302151034.27829-4-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/huge_memory.c |    2 --
 1 file changed, 2 deletions(-)

diff -puN mm/huge_memory.c~thp-fix-madv_dontneed-vs-madv_free-race mm/huge_memory.c
--- a/mm/huge_memory.c~thp-fix-madv_dontneed-vs-madv_free-race
+++ a/mm/huge_memory.c
@@ -1565,8 +1565,6 @@ bool madvise_free_huge_pmd(struct mmu_ga
 	unlock_page(page);
 
 	if (pmd_young(orig_pmd) || pmd_dirty(orig_pmd)) {
-		orig_pmd = pmdp_huge_get_and_clear_full(tlb->mm, addr, pmd,
-			tlb->fullmm);
 		orig_pmd = pmd_mkold(orig_pmd);
 		orig_pmd = pmd_mkclean(orig_pmd);
 
_

Patches currently in -mm which might be from kirill.shutemov@linux.intel.com are

rmap-fix-null-pointer-dereference-on-thp-munlocking.patch
thp-reduce-indentation-level-in-change_huge_pmd.patch
thp-fix-madv_dontneed-vs-numa-balancing-race.patch
thp-fix-madv_dontneed-vs-madv_free-race.patch
thp-fix-madv_dontneed-vs-clear-soft-dirty-race.patch


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

only message in thread, other threads:[~2017-03-03 22:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03 22:30 + thp-fix-madv_dontneed-vs-madv_free-race.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).