diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-03-07 03:27:30 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-03-07 03:27:30 -0500 |
commit | ec87e1cf7d8399d81d8965c6d852f8057a8dd687 (patch) | |
tree | 472a168fa4861090edf110c8a9712a5c15ea259f /mm/memory.c | |
parent | 869ae76147ffdf21ad24f0e599303cd58a2bb39f (diff) | |
parent | f6cede5b49e822ebc41a099fe41ab4989f64e2cb (diff) |
Merge tag 'v4.5-rc7' into x86/asm, to pick up SMAP fix
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c index 38090ca37a08..906d8e3b42c0 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -3425,8 +3425,18 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
3425 | if (unlikely(pmd_none(*pmd)) && | 3425 | if (unlikely(pmd_none(*pmd)) && |
3426 | unlikely(__pte_alloc(mm, vma, pmd, address))) | 3426 | unlikely(__pte_alloc(mm, vma, pmd, address))) |
3427 | return VM_FAULT_OOM; | 3427 | return VM_FAULT_OOM; |
3428 | /* if an huge pmd materialized from under us just retry later */ | 3428 | /* |
3429 | if (unlikely(pmd_trans_huge(*pmd) || pmd_devmap(*pmd))) | 3429 | * If a huge pmd materialized under us just retry later. Use |
3430 | * pmd_trans_unstable() instead of pmd_trans_huge() to ensure the pmd | ||
3431 | * didn't become pmd_trans_huge under us and then back to pmd_none, as | ||
3432 | * a result of MADV_DONTNEED running immediately after a huge pmd fault | ||
3433 | * in a different thread of this mm, in turn leading to a misleading | ||
3434 | * pmd_trans_huge() retval. All we have to ensure is that it is a | ||
3435 | * regular pmd that we can walk with pte_offset_map() and we can do that | ||
3436 | * through an atomic read in C, which is what pmd_trans_unstable() | ||
3437 | * provides. | ||
3438 | */ | ||
3439 | if (unlikely(pmd_trans_unstable(pmd) || pmd_devmap(*pmd))) | ||
3430 | return 0; | 3440 | return 0; |
3431 | /* | 3441 | /* |
3432 | * A regular pmd is established and it can't morph into a huge pmd | 3442 | * A regular pmd is established and it can't morph into a huge pmd |