Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1591223

[PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race

From "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race
Date 2017-03-02 17:00 +0100
Message-ID <tgBj4-4tT-29@gated-at.bofh.it> (permalink)
References <tgAGm-4bI-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Minchan Kim <minchan@kernel.org>
---
 mm/huge_memory.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index bb2b3646bd78..324217c31ec9 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1566,8 +1566,6 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
 		deactivate_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);
 
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] thp: fix few MADV_DONTNEED races "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-03-02 16:20 +0100
  [PATCH 4/4] thp: fix MADV_DONTNEED vs clear soft dirty race "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-03-02 17:00 +0100
    Re: [PATCH 4/4] thp: fix MADV_DONTNEED vs clear soft dirty race Andrew Morton <akpm@linux-foundation.org> - 2017-03-03 23:50 +0100
  [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-03-02 17:00 +0100
    Re: [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-03-03 06:40 +0100
      Re: [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-03-03 11:30 +0100
        Re: [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race Minchan Kim <minchan@kernel.org> - 2017-03-06 03:00 +0100
          Re: [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-03-07 15:40 +0100
    Re: [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2017-03-06 03:50 +0100
      Re: [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-03-07 15:50 +0100
  [PATCH 1/4] thp: reduce indentation level in change_huge_pmd() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-03-02 17:00 +0100
  [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-03-03 03:20 +0100
    Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race Dave Hansen <dave.hansen@intel.com> - 2017-03-03 18:20 +0100

csiph-web