diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index e0a9b0ce4f10..bb1369f7b9b4 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -184,10 +184,14 @@ static int tlb_next_batch(struct mmu_gather *tlb) | |||
184 | return 1; | 184 | return 1; |
185 | } | 185 | } |
186 | 186 | ||
187 | if (tlb->batch_count == MAX_GATHER_BATCH_COUNT) | ||
188 | return 0; | ||
189 | |||
187 | batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); | 190 | batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); |
188 | if (!batch) | 191 | if (!batch) |
189 | return 0; | 192 | return 0; |
190 | 193 | ||
194 | tlb->batch_count++; | ||
191 | batch->next = NULL; | 195 | batch->next = NULL; |
192 | batch->nr = 0; | 196 | batch->nr = 0; |
193 | batch->max = MAX_GATHER_BATCH; | 197 | batch->max = MAX_GATHER_BATCH; |
@@ -216,6 +220,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm) | |||
216 | tlb->local.nr = 0; | 220 | tlb->local.nr = 0; |
217 | tlb->local.max = ARRAY_SIZE(tlb->__pages); | 221 | tlb->local.max = ARRAY_SIZE(tlb->__pages); |
218 | tlb->active = &tlb->local; | 222 | tlb->active = &tlb->local; |
223 | tlb->batch_count = 0; | ||
219 | 224 | ||
220 | #ifdef CONFIG_HAVE_RCU_TABLE_FREE | 225 | #ifdef CONFIG_HAVE_RCU_TABLE_FREE |
221 | tlb->batch = NULL; | 226 | tlb->batch = NULL; |
@@ -3706,6 +3711,14 @@ retry: | |||
3706 | if (pmd_trans_huge(orig_pmd)) { | 3711 | if (pmd_trans_huge(orig_pmd)) { |
3707 | unsigned int dirty = flags & FAULT_FLAG_WRITE; | 3712 | unsigned int dirty = flags & FAULT_FLAG_WRITE; |
3708 | 3713 | ||
3714 | /* | ||
3715 | * If the pmd is splitting, return and retry the | ||
3716 | * the fault. Alternative: wait until the split | ||
3717 | * is done, and goto retry. | ||
3718 | */ | ||
3719 | if (pmd_trans_splitting(orig_pmd)) | ||
3720 | return 0; | ||
3721 | |||
3709 | if (pmd_numa(orig_pmd)) | 3722 | if (pmd_numa(orig_pmd)) |
3710 | return do_huge_pmd_numa_page(mm, vma, address, | 3723 | return do_huge_pmd_numa_page(mm, vma, address, |
3711 | orig_pmd, pmd); | 3724 | orig_pmd, pmd); |