diff options
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ebad6bbb3501..832f676ca038 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -334,6 +334,7 @@ static unsigned long set_max_huge_pages(unsigned long count) | |||
334 | return nr_huge_pages; | 334 | return nr_huge_pages; |
335 | 335 | ||
336 | spin_lock(&hugetlb_lock); | 336 | spin_lock(&hugetlb_lock); |
337 | count = max(count, reserved_huge_pages); | ||
337 | try_to_free_low(count); | 338 | try_to_free_low(count); |
338 | while (count < nr_huge_pages) { | 339 | while (count < nr_huge_pages) { |
339 | struct page *page = dequeue_huge_page(NULL, 0); | 340 | struct page *page = dequeue_huge_page(NULL, 0); |
@@ -697,9 +698,10 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
697 | pfn_offset = (vaddr & ~HPAGE_MASK) >> PAGE_SHIFT; | 698 | pfn_offset = (vaddr & ~HPAGE_MASK) >> PAGE_SHIFT; |
698 | page = pte_page(*pte); | 699 | page = pte_page(*pte); |
699 | same_page: | 700 | same_page: |
700 | get_page(page); | 701 | if (pages) { |
701 | if (pages) | 702 | get_page(page); |
702 | pages[i] = page + pfn_offset; | 703 | pages[i] = page + pfn_offset; |
704 | } | ||
703 | 705 | ||
704 | if (vmas) | 706 | if (vmas) |
705 | vmas[i] = vma; | 707 | vmas[i] = vma; |