X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=mm%2Fmemory.c;h=25fc46e872142a11692e3b44402cab89ca644fb3;hb=d2930ede5218be28413a00130a6895d14393c325;hp=747a01d495f2c5cd0ff71e0910925a3374af316d;hpb=baa99c926718c1a1549a7e08383f53a8e2944f04;p=linux-2.6-microblaze.git diff --git a/mm/memory.c b/mm/memory.c index 747a01d495f2..25fc46e87214 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4026,8 +4026,17 @@ vm_fault_t finish_fault(struct vm_fault *vmf) return ret; } - if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd))) + if (vmf->prealloc_pte) { + vmf->ptl = pmd_lock(vma->vm_mm, vmf->pmd); + if (likely(pmd_none(*vmf->pmd))) { + mm_inc_nr_ptes(vma->vm_mm); + pmd_populate(vma->vm_mm, vmf->pmd, vmf->prealloc_pte); + vmf->prealloc_pte = NULL; + } + spin_unlock(vmf->ptl); + } else if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd))) { return VM_FAULT_OOM; + } } /* See comment in handle_pte_fault() */