freebsd-dev/sys/vm
Brian Feldman a534973af4 The new contigmalloc(9) has a bad degenerate case where there were
many regions checked again and again despite knowing the pages
contained were not usable and only satisfied the alignment constraints
This case was compounded, especially for large allocations, by the
practice of looping from the top of memory so as to keep out of the
important low-memory regions.  While the old contigmalloc(9) has the
same problem, it is not as noticeable due to looping from the low
memory to high.

This degenerate case is fixed, as well as reversing the sense of the
rest of the loops within it, to provide a tremendous speed increase.
This makes the best case O(n * VM overhead) much more likely than the
worst case O(4 * VM overhead).  For comparison, the worst case for old
contigmalloc would be O(5 * VM overhead) in addition to its strategy
of turning used memory into free being highly pessimal.

Also, fix a bug that in practice most likely couldn't have been triggered,
int the new contigmalloc(9): it walked backwards from the end of memory
without accounting for how many pages it needed.  Potentially, nonexistant
pages could have been mapped.  This hasn't occurred because the kernel
generally requests as its first contigmalloc(9) a single page.

Reported by: Nicolas Dehaine <nicko@stbernard.com>, wes
MFC After: 1 month
More testing by: Nicolas Dehaine <nicko@stbernard.com>, wes
2005-06-11 00:05:16 +00:00
..
default_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
device_pager.c Add a comment to the effect that fictitious pages do not require the 2005-06-10 17:27:54 +00:00
memguard.c Well, it seems that I pre-maturely removed the "All rights reserved" 2005-02-16 21:45:59 +00:00
memguard.h Well, it seems that I pre-maturely removed the "All rights reserved" 2005-02-16 21:45:59 +00:00
phys_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
pmap.h Introduce a procedure, pmap_page_init(), that initializes the 2005-06-10 03:33:36 +00:00
swap_pager.c Reduce the number of times that we acquire and release locks in 2005-05-20 21:26:05 +00:00
swap_pager.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma_core.c Modify UMA to use critical sections to protect per-CPU caches, rather than 2005-04-29 18:56:36 +00:00
uma_dbg.c Well, it seems that I pre-maturely removed the "All rights reserved" 2005-02-16 21:45:59 +00:00
uma_dbg.h Well, it seems that I pre-maturely removed the "All rights reserved" 2005-02-16 21:45:59 +00:00
uma_int.h Modify UMA to use critical sections to protect per-CPU caches, rather than 2005-04-29 18:56:36 +00:00
uma.h Well, it seems that I pre-maturely removed the "All rights reserved" 2005-02-16 21:45:59 +00:00
vm_contig.c The new contigmalloc(9) has a bad degenerate case where there were 2005-06-11 00:05:16 +00:00
vm_extern.h - Change the vm_mmap() function to accept an objtype_t parameter specifying 2005-04-01 20:00:11 +00:00
vm_fault.c The final test in unlock_and_deallocate() to determine if GIANT needs to be 2005-05-12 04:09:41 +00:00
vm_glue.c Use low level constructs borrowed from interrupt threads to wait for 2005-05-23 23:01:53 +00:00
vm_init.c Add the vm.exec_map_entries tunable and read-only sysctl, which controls 2005-04-25 19:22:05 +00:00
vm_kern.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_kern.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_map.c Remove GIANT_REQUIRED from vmspace_exec(). 2005-05-02 07:05:20 +00:00
vm_map.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_meter.c Enable debug_mpsafevm on ia64 due to the severe functional regression 2005-05-08 23:56:16 +00:00
vm_mmap.c Move MAC check_vnode_mmap entry point out from being exclusive to 2005-04-14 16:03:30 +00:00
vm_object.c - We need to inhert the OBJ_NEEDGIANT flag from the original object in 2005-05-04 20:54:16 +00:00
vm_object.h - Add a new object flag "OBJ_NEEDSGIANT". We set this flag if the 2005-05-03 11:11:26 +00:00
vm_page.c - In vm_page_insert() hold the backing vnode when the first page 2005-03-15 14:14:09 +00:00
vm_page.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageout.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageout.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageq.c Introduce a procedure, pmap_page_init(), that initializes the 2005-06-10 03:33:36 +00:00
vm_pager.c Remove calls to spl*(). 2005-05-18 20:45:33 +00:00
vm_pager.h Update some comments to reflect the change from spl-based to lock-based 2005-05-18 22:08:52 +00:00
vm_param.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_unix.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_zeroidle.c Set the scheduling class of the zeroidle thread to PRI_IDLE. 2005-02-04 06:18:31 +00:00
vm.h - Change the vm_mmap() function to accept an objtype_t parameter specifying 2005-04-01 20:00:11 +00:00
vnode_pager.c Remove a stale comment concerning spl* usage. 2005-05-19 03:53:07 +00:00
vnode_pager.h Move the body of vop_stdcreatevobject() over to the vnode_pager under 2005-01-24 21:21:59 +00:00