aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/mm
diff options
context:
space:
mode:
authorMichel Lespinasse <walken@google.com>2013-02-21 18:10:29 -0500
committerTony Luck <tony.luck@intel.com>2013-02-22 16:48:24 -0500
commite31048af84e24c99136acaad99f9273b147f8444 (patch)
tree858f5a6e1d669033974ef0d2069cac4056035970 /arch/ia64/mm
parentf53f232504253a5e9f8f19ac1aa1b9161d7e6d2a (diff)
mm: use vm_unmapped_area() in hugetlbfs on ia64 architecture
Update the ia64 hugetlb_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse <walken@google.com> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/mm')
-rw-r--r--arch/ia64/mm/hugetlbpage.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 5ca674b74737..76069c18ee42 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -148,7 +148,7 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb,
148unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, 148unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
149 unsigned long pgoff, unsigned long flags) 149 unsigned long pgoff, unsigned long flags)
150{ 150{
151 struct vm_area_struct *vmm; 151 struct vm_unmapped_area_info info;
152 152
153 if (len > RGN_MAP_LIMIT) 153 if (len > RGN_MAP_LIMIT)
154 return -ENOMEM; 154 return -ENOMEM;
@@ -165,16 +165,14 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, u
165 /* This code assumes that RGN_HPAGE != 0. */ 165 /* This code assumes that RGN_HPAGE != 0. */
166 if ((REGION_NUMBER(addr) != RGN_HPAGE) || (addr & (HPAGE_SIZE - 1))) 166 if ((REGION_NUMBER(addr) != RGN_HPAGE) || (addr & (HPAGE_SIZE - 1)))
167 addr = HPAGE_REGION_BASE; 167 addr = HPAGE_REGION_BASE;
168 else 168
169 addr = ALIGN(addr, HPAGE_SIZE); 169 info.flags = 0;
170 for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) { 170 info.length = len;
171 /* At this point: (!vmm || addr < vmm->vm_end). */ 171 info.low_limit = addr;
172 if (REGION_OFFSET(addr) + len > RGN_MAP_LIMIT) 172 info.high_limit = HPAGE_REGION_BASE + RGN_MAP_LIMIT;
173 return -ENOMEM; 173 info.align_mask = PAGE_MASK & (HPAGE_SIZE - 1);
174 if (!vmm || (addr + len) <= vmm->vm_start) 174 info.align_offset = 0;
175 return addr; 175 return vm_unmapped_area(&info);
176 addr = ALIGN(vmm->vm_end, HPAGE_SIZE);
177 }
178} 176}
179 177
180static int __init hugetlb_setup_sz(char *str) 178static int __init hugetlb_setup_sz(char *str)