freebsd-dev/sys/vm
Bosko Milekic 08442f8a82 Introduce numerous SMP friendly changes to the mbuf allocator. Namely,
introduce a modified allocation mechanism for mbufs and mbuf clusters; one
which can scale under SMP and which offers the possibility of resource
reclamation to be implemented in the future. Notable advantages:

 o Reduce contention for SMP by offering per-CPU pools and locks.
 o Better use of data cache due to per-CPU pools.
 o Much less code cache pollution due to excessively large allocation macros.
 o Framework for `grouping' objects from same page together so as to be able
   to possibly free wired-down pages back to the system if they are no longer
   needed by the network stacks.

 Additional things changed with this addition:

  - Moved some mbuf specific declarations and initializations from
    sys/conf/param.c into mbuf-specific code where they belong.
  - m_getclr() has been renamed to m_get_clrd() because the old name is really
    confusing. m_getclr() HAS been preserved though and is defined to the new
    name. No tree sweep has been done "to change the interface," as the old
    name will continue to be supported and is not depracated. The change was
    merely done because m_getclr() sounds too much like "m_get a cluster."
  - TEMPORARILY disabled mbtypes statistics displaying in netstat(1) and
    systat(1) (see TODO below).
  - Fixed systat(1) to display number of "free mbufs" based on new per-CPU
    stat structures.
  - Fixed netstat(1) to display new per-CPU stats based on sysctl-exported
    per-CPU stat structures. All infos are fetched via sysctl.

 TODO (in order of priority):

  - Re-enable mbtypes statistics in both netstat(1) and systat(1) after
    introducing an SMP friendly way to collect the mbtypes stats under the
    already introduced per-CPU locks (i.e. hopefully don't use atomic() - it
    seems too costly for a mere stat update, especially when other locks are
    already present).
  - Optionally have systat(1) display not only "total free mbufs" but also
    "total free mbufs per CPU pool."
  - Fix minor length-fetching issues in netstat(1) related to recently
    re-enabled option to read mbuf stats from a core file.
  - Move reference counters at least for mbuf clusters into an unused portion
    of the cluster itself, to save space and need to allocate a counter.
  - Look into introducing resource freeing possibly from a kproc.

Reviewed by (in parts): jlemon, jake, silby, terry
Tested by: jlemon (Intel & Alpha), mjacob (Intel & Alpha)
Preliminary performance measurements: jlemon (and me, obviously)
URL: http://people.freebsd.org/~bmilekic/mb_alloc/
2001-06-22 06:35:32 +00:00
..
default_pager.c Introduce a global lock for the vm subsystem (vm_mtx). 2001-05-19 01:28:09 +00:00
device_pager.c Assert Giant is held for the device pager alloc and getpages methods since 2001-05-23 22:27:52 +00:00
phys_pager.c Set the phys_pager_alloc_lock to 1 when it is acquired so that it is 2001-05-23 19:52:23 +00:00
pmap.h Unrevert the pmap_map() changes. They weren't broken on x86. 2001-03-07 05:29:21 +00:00
swap_pager.c - Fix the sw_alloc_interlock to actually lock itself when the lock is 2001-05-23 22:31:15 +00:00
swap_pager.h - If swap metadata does not fit into the KVM, reduce the number of 2000-12-13 10:01:00 +00:00
vm_extern.h
vm_fault.c Take a more conservative approach and still lock Giant around VM faults 2001-05-23 22:09:18 +00:00
vm_glue.c Put the scheduler, vmdaemon, and pagedaemon kthreads back under Giant for 2001-06-20 00:48:20 +00:00
vm_init.c Sort includes from previous commit. 2001-05-22 05:35:45 +00:00
vm_kern.c Introduce numerous SMP friendly changes to the mbuf allocator. Namely, 2001-06-22 06:35:32 +00:00
vm_kern.h Introduce numerous SMP friendly changes to the mbuf allocator. Namely, 2001-06-22 06:35:32 +00:00
vm_map.c Introduce numerous SMP friendly changes to the mbuf allocator. Namely, 2001-06-22 06:35:32 +00:00
vm_map.h Two fixes to the out-of-swap process termination code. First, start killing 2001-06-09 18:06:58 +00:00
vm_meter.c Clean up the code exporting interrupt statistics via sysctl a bit: 2001-06-01 13:23:28 +00:00
vm_mmap.c Stick VM syscalls back under Giant if the BLEED option is not defined. 2001-05-24 18:04:29 +00:00
vm_object.c Introduce numerous SMP friendly changes to the mbuf allocator. Namely, 2001-06-22 06:35:32 +00:00
vm_object.h Introduce a global lock for the vm subsystem (vm_mtx). 2001-05-19 01:28:09 +00:00
vm_page.c This patch implements O_DIRECT about 80% of the way. It takes a patchset 2001-05-24 07:22:27 +00:00
vm_page.h This patch implements O_DIRECT about 80% of the way. It takes a patchset 2001-05-24 07:22:27 +00:00
vm_pageout.c Don't lock around swap_pager_swap_init() that is only called once during 2001-06-20 23:34:06 +00:00
vm_pageout.h
vm_pager.c Introduce a global lock for the vm subsystem (vm_mtx). 2001-05-19 01:28:09 +00:00
vm_pager.h Introduce a global lock for the vm subsystem (vm_mtx). 2001-05-19 01:28:09 +00:00
vm_param.h Change the way information about swap devices is exported to be more 2001-06-01 22:53:10 +00:00
vm_swap.c Change the way information about swap devices is exported to be more 2001-06-01 22:53:10 +00:00
vm_unix.c Stick VM syscalls back under Giant if the BLEED option is not defined. 2001-05-24 18:04:29 +00:00
vm_zone.c Introduce a global lock for the vm subsystem (vm_mtx). 2001-05-19 01:28:09 +00:00
vm_zone.h Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
vm.h Introduce a global lock for the vm subsystem (vm_mtx). 2001-05-19 01:28:09 +00:00
vnode_pager.c Don't hold the VM lock across VOP's and other things that can sleep. 2001-05-29 16:58:25 +00:00
vnode_pager.h vnode_pager_freepage() is really vm_page_free() in disguise, 2001-04-19 06:18:23 +00:00