diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/mm/memory.c b/mm/memory.c index 2dd2f9ab57f4..a52663c0612d 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -400,10 +400,10 @@ void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *vma, | |||
400 | } | 400 | } |
401 | } | 401 | } |
402 | 402 | ||
403 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address) | 403 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd) |
404 | { | 404 | { |
405 | spinlock_t *ptl; | 405 | spinlock_t *ptl; |
406 | pgtable_t new = pte_alloc_one(mm, address); | 406 | pgtable_t new = pte_alloc_one(mm); |
407 | if (!new) | 407 | if (!new) |
408 | return -ENOMEM; | 408 | return -ENOMEM; |
409 | 409 | ||
@@ -434,9 +434,9 @@ int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address) | |||
434 | return 0; | 434 | return 0; |
435 | } | 435 | } |
436 | 436 | ||
437 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address) | 437 | int __pte_alloc_kernel(pmd_t *pmd) |
438 | { | 438 | { |
439 | pte_t *new = pte_alloc_one_kernel(&init_mm, address); | 439 | pte_t *new = pte_alloc_one_kernel(&init_mm); |
440 | if (!new) | 440 | if (!new) |
441 | return -ENOMEM; | 441 | return -ENOMEM; |
442 | 442 | ||
@@ -2896,7 +2896,7 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf) | |||
2896 | * | 2896 | * |
2897 | * Here we only have down_read(mmap_sem). | 2897 | * Here we only have down_read(mmap_sem). |
2898 | */ | 2898 | */ |
2899 | if (pte_alloc(vma->vm_mm, vmf->pmd, vmf->address)) | 2899 | if (pte_alloc(vma->vm_mm, vmf->pmd)) |
2900 | return VM_FAULT_OOM; | 2900 | return VM_FAULT_OOM; |
2901 | 2901 | ||
2902 | /* See the comment in pte_alloc_one_map() */ | 2902 | /* See the comment in pte_alloc_one_map() */ |
@@ -3043,7 +3043,7 @@ static vm_fault_t pte_alloc_one_map(struct vm_fault *vmf) | |||
3043 | pmd_populate(vma->vm_mm, vmf->pmd, vmf->prealloc_pte); | 3043 | pmd_populate(vma->vm_mm, vmf->pmd, vmf->prealloc_pte); |
3044 | spin_unlock(vmf->ptl); | 3044 | spin_unlock(vmf->ptl); |
3045 | vmf->prealloc_pte = NULL; | 3045 | vmf->prealloc_pte = NULL; |
3046 | } else if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd, vmf->address))) { | 3046 | } else if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd))) { |
3047 | return VM_FAULT_OOM; | 3047 | return VM_FAULT_OOM; |
3048 | } | 3048 | } |
3049 | map_pte: | 3049 | map_pte: |
@@ -3122,7 +3122,7 @@ static vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page) | |||
3122 | * related to pte entry. Use the preallocated table for that. | 3122 | * related to pte entry. Use the preallocated table for that. |
3123 | */ | 3123 | */ |
3124 | if (arch_needs_pgtable_deposit() && !vmf->prealloc_pte) { | 3124 | if (arch_needs_pgtable_deposit() && !vmf->prealloc_pte) { |
3125 | vmf->prealloc_pte = pte_alloc_one(vma->vm_mm, vmf->address); | 3125 | vmf->prealloc_pte = pte_alloc_one(vma->vm_mm); |
3126 | if (!vmf->prealloc_pte) | 3126 | if (!vmf->prealloc_pte) |
3127 | return VM_FAULT_OOM; | 3127 | return VM_FAULT_OOM; |
3128 | smp_wmb(); /* See comment in __pte_alloc() */ | 3128 | smp_wmb(); /* See comment in __pte_alloc() */ |
@@ -3360,8 +3360,7 @@ static vm_fault_t do_fault_around(struct vm_fault *vmf) | |||
3360 | start_pgoff + nr_pages - 1); | 3360 | start_pgoff + nr_pages - 1); |
3361 | 3361 | ||
3362 | if (pmd_none(*vmf->pmd)) { | 3362 | if (pmd_none(*vmf->pmd)) { |
3363 | vmf->prealloc_pte = pte_alloc_one(vmf->vma->vm_mm, | 3363 | vmf->prealloc_pte = pte_alloc_one(vmf->vma->vm_mm); |
3364 | vmf->address); | ||
3365 | if (!vmf->prealloc_pte) | 3364 | if (!vmf->prealloc_pte) |
3366 | goto out; | 3365 | goto out; |
3367 | smp_wmb(); /* See comment in __pte_alloc() */ | 3366 | smp_wmb(); /* See comment in __pte_alloc() */ |