Messages in this thread Patch in this message | | | Date | Tue, 07 Jun 2005 10:49:04 -0400 | From | Wolfgang Wander <> | Subject | Re: 2.6.12-rc6-mm1 |
| |
Wolfgang Wander wrote: > Andrew Morton wrote: > >> +avoiding-mmap-fragmentation-revert-unneeded-64-bit-changes-vs-x86_64-task_size-fixes-for-compatibility-mode-processes.patch >> > > > As a heads-up. > > This one breaks the fragmentation reduction patch in 32 bit emulation mode. > Our test case shows the standard 17 fragmented regions in > /proc/self/maps (as in > the 2.6 standard kernel) vs the 2 regions in 2.6.12-rc5-mm2 (and before). > > Somehow the new way of detecting 32 bit remulation mode seems to fail here. > > I'll try to figure out a fix. >
Here is one possibility:
Since rc6 the difference between TASK_UNMAPPED_64 and TASK_UNMAPPED_32 is gone and both are now merged into TASK_UNMAPPED_BASE. Therefore we can no longer check our local base against TASK_UNMAPPED_BASE to see if we are running in 32bit emulation mode. The appended patch uses other (hopefully the right) means.
Tested on x86_64 in 32 and 64 mode (64 bit fragments as desired, 32 bit collapses as desired).
Signed-off-by: Wolfgang Wander <wwc@rentec.com>
--- arch/x86_64/kernel/sys_x86_64.c~ 2005-06-07 09:12:31.000000000 -0400 +++ arch/x86_64/kernel/sys_x86_64.c 2005-06-07 10:32:07.000000000 -0400 @@ -105,7 +105,8 @@ arch_get_unmapped_area(struct file *filp (!vma || addr + len <= vma->vm_start)) return addr; } - if (begin != TASK_UNMAPPED_BASE && len <= mm->cached_hole_size) { + if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32)) + && len <= mm->cached_hole_size) { mm->cached_hole_size = 0; mm->free_area_cache = begin; } | |