]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.77/mm-thp-fix-call-to-mmu_notifier-in-set_pmd_migration_entry-v2.patch
6.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.77 / mm-thp-fix-call-to-mmu_notifier-in-set_pmd_migration_entry-v2.patch
1 From bfba8e5cf28f413aa05571af493871d74438979f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= <jglisse@redhat.com>
3 Date: Fri, 12 Oct 2018 21:34:36 -0700
4 Subject: mm/thp: fix call to mmu_notifier in set_pmd_migration_entry() v2
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Jérôme Glisse <jglisse@redhat.com>
10
11 commit bfba8e5cf28f413aa05571af493871d74438979f upstream.
12
13 Inside set_pmd_migration_entry() we are holding page table locks and thus
14 we can not sleep so we can not call invalidate_range_start/end()
15
16 So remove call to mmu_notifier_invalidate_range_start/end() because they
17 are call inside the function calling set_pmd_migration_entry() (see
18 try_to_unmap_one()).
19
20 Link: http://lkml.kernel.org/r/20181012181056.7864-1-jglisse@redhat.com
21 Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
22 Reported-by: Andrea Arcangeli <aarcange@redhat.com>
23 Reviewed-by: Zi Yan <zi.yan@cs.rutgers.edu>
24 Acked-by: Michal Hocko <mhocko@kernel.org>
25 Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
27 Cc: "H. Peter Anvin" <hpa@zytor.com>
28 Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
29 Cc: Dave Hansen <dave.hansen@intel.com>
30 Cc: David Nellans <dnellans@nvidia.com>
31 Cc: Ingo Molnar <mingo@elte.hu>
32 Cc: Mel Gorman <mgorman@techsingularity.net>
33 Cc: Minchan Kim <minchan@kernel.org>
34 Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
35 Cc: Thomas Gleixner <tglx@linutronix.de>
36 Cc: Vlastimil Babka <vbabka@suse.cz>
37 Cc: <stable@vger.kernel.org>
38 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
39 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40
41 ---
42 mm/huge_memory.c | 6 ------
43 1 file changed, 6 deletions(-)
44
45 --- a/mm/huge_memory.c
46 +++ b/mm/huge_memory.c
47 @@ -2843,9 +2843,6 @@ void set_pmd_migration_entry(struct page
48 if (!(pvmw->pmd && !pvmw->pte))
49 return;
50
51 - mmu_notifier_invalidate_range_start(mm, address,
52 - address + HPAGE_PMD_SIZE);
53 -
54 flush_cache_range(vma, address, address + HPAGE_PMD_SIZE);
55 pmdval = *pvmw->pmd;
56 pmdp_invalidate(vma, address, pvmw->pmd);
57 @@ -2858,9 +2855,6 @@ void set_pmd_migration_entry(struct page
58 set_pmd_at(mm, address, pvmw->pmd, pmdswp);
59 page_remove_rmap(page, true);
60 put_page(page);
61 -
62 - mmu_notifier_invalidate_range_end(mm, address,
63 - address + HPAGE_PMD_SIZE);
64 }
65
66 void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)