aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index ea0826ff2663..f29b7dc02c39 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -314,6 +314,8 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
314 BUG_ON(start & ~HPAGE_MASK); 314 BUG_ON(start & ~HPAGE_MASK);
315 BUG_ON(end & ~HPAGE_MASK); 315 BUG_ON(end & ~HPAGE_MASK);
316 316
317 spin_lock(&mm->page_table_lock);
318
317 /* Update high watermark before we lower rss */ 319 /* Update high watermark before we lower rss */
318 update_hiwater_rss(mm); 320 update_hiwater_rss(mm);
319 321
@@ -333,17 +335,9 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
333 put_page(page); 335 put_page(page);
334 add_mm_counter(mm, file_rss, (int) -(HPAGE_SIZE / PAGE_SIZE)); 336 add_mm_counter(mm, file_rss, (int) -(HPAGE_SIZE / PAGE_SIZE));
335 } 337 }
336 flush_tlb_range(vma, start, end);
337}
338 338
339void zap_hugepage_range(struct vm_area_struct *vma,
340 unsigned long start, unsigned long length)
341{
342 struct mm_struct *mm = vma->vm_mm;
343
344 spin_lock(&mm->page_table_lock);
345 unmap_hugepage_range(vma, start, start + length);
346 spin_unlock(&mm->page_table_lock); 339 spin_unlock(&mm->page_table_lock);
340 flush_tlb_range(vma, start, end);
347} 341}
348 342
349int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) 343int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)