aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/sys_sparc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/sys_sparc.c')
-rw-r--r--arch/sparc64/kernel/sys_sparc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 0077f02f4b37..5f8c822a2b4a 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -84,6 +84,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
84 return addr; 84 return addr;
85 } 85 }
86 86
87 if (len <= mm->cached_hole_size) {
88 mm->cached_hole_size = 0;
89 mm->free_area_cache = TASK_UNMAPPED_BASE;
90 }
87 start_addr = addr = mm->free_area_cache; 91 start_addr = addr = mm->free_area_cache;
88 92
89 task_size -= len; 93 task_size -= len;
@@ -103,6 +107,7 @@ full_search:
103 if (task_size < addr) { 107 if (task_size < addr) {
104 if (start_addr != TASK_UNMAPPED_BASE) { 108 if (start_addr != TASK_UNMAPPED_BASE) {
105 start_addr = addr = TASK_UNMAPPED_BASE; 109 start_addr = addr = TASK_UNMAPPED_BASE;
110 mm->cached_hole_size = 0;
106 goto full_search; 111 goto full_search;
107 } 112 }
108 return -ENOMEM; 113 return -ENOMEM;
@@ -114,6 +119,9 @@ full_search:
114 mm->free_area_cache = addr + len; 119 mm->free_area_cache = addr + len;
115 return addr; 120 return addr;
116 } 121 }
122 if (addr + mm->cached_hole_size < vma->vm_start)
123 mm->cached_hole_size = vma->vm_start - addr;
124
117 addr = vma->vm_end; 125 addr = vma->vm_end;
118 if (do_color_align) 126 if (do_color_align)
119 addr = COLOUR_ALIGN(addr, pgoff); 127 addr = COLOUR_ALIGN(addr, pgoff);