freebsd-nq/sys/vm
Alfred Perlstein 93c7ba9f09 Address a number of problems with sysctl_vm_zone().
The zone allocator's locks should be leaflocks, meaning that they
should never be held when entering into another subsystem, however
the sysctl grabs the zone global mutex and individual zone mutexes
while holding the lock it calls SYSCTL_OUT which recurses into the
VM subsystem in order to wire user memory to do a safe copy.  This
can block and cause lock order reversals.

To fix this:
  lock zone global.
  get a count of the number of zones.
  unlock global.
  allocate temporary storage.
  format and SYSCTL_OUT the banner.
  lock global.
  traverse list.
    make sure we haven't looped more than the initial count taken
      to avoid overflowing the allocated buffer.
    lock each nodes.
    read values and format into buffer.
    unlock individual node.
  unlock global.
  format and SYSCTL_OUT the rest of the data.
  free storage.
  return.

Other problems included not checking for errors when doing sysctl out
of the column header.  Fixed.

Inconsistant termination of the copied string. Fixed.

Objected to by: des (for not using sbuf)

Since the output is not variable length and I'm actually over
allocating signifigantly and I'd like to get this fixed now, I'll
work on the sbuf convertion at a later date.  I would not object
to someone else taking it upon themselves to convert it to sbuf.
I hold no MAINTIANER rights to this code (for now).
2001-04-27 22:24:45 +00:00
..
default_pager.c - If swap metadata does not fit into the KVM, reduce the number of 2000-12-13 10:01:00 +00:00
device_pager.c Protect pager object creation with sx locks. 2001-04-18 20:24:16 +00:00
phys_pager.c Protect pager object creation with sx locks. 2001-04-18 20:24:16 +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 Protect pager object creation with sx locks. 2001-04-18 20:24:16 +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 Remove unused 3rd argument from vsunlock() which abused B_WRITE. 2000-03-13 10:47:24 +00:00
vm_fault.c Fix a lock reversal problem in the VM subsystem related to threaded 2001-03-14 06:48:53 +00:00
vm_glue.c Convert the allproc and proctree locks from lockmgr locks to sx locks. 2001-03-28 11:52:56 +00:00
vm_init.c Add missing include. 2001-01-24 06:54:24 +00:00
vm_kern.c Add mtx_assert()'s to verify that kmem_alloc() and kmem_free() are called 2001-01-24 11:27:29 +00:00
vm_kern.h Fix null-pointer dereference crash when the system is intentionally 2000-02-16 21:11:33 +00:00
vm_map.c remove truncated part from commment 2001-04-12 21:50:03 +00:00
vm_map.h Fix the botched rev 1.59 where I made it such that without INVARIANTS 2001-04-18 05:30:24 +00:00
vm_meter.c use TAILQ_FOREACH, fix a comment's location 2001-04-15 10:22:04 +00:00
vm_mmap.c This patchset fixes a large number of file descriptor race conditions. 2000-11-18 21:01:04 +00:00
vm_object.c Correct #includes to work with fixed sys/mount.h. 2001-04-23 09:05:15 +00:00
vm_object.h use TAILQ_FOREACH, fix a comment's location 2001-04-15 10:22:04 +00:00
vm_page.c Unrevert the pmap_map() changes. They weren't broken on x86. 2001-03-07 05:29:21 +00:00
vm_page.h This implements a better launder limiting solution. There was a solution 2000-12-26 19:41:38 +00:00
vm_pageout.c Convert the allproc and proctree locks from lockmgr locks to sx locks. 2001-03-28 11:52:56 +00:00
vm_pageout.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
vm_pager.c This patch removes the VOP_BWRITE() vector. 2001-04-17 08:56:39 +00:00
vm_pager.h protect pbufs and associated counts with a mutex 2001-04-13 10:23:32 +00:00
vm_param.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
vm_swap.c Introduce per-swap area accounting in the VM system, and export 2001-02-23 18:46:21 +00:00
vm_unix.c If a process is over its resource limit for datasize, still allow 2000-10-06 13:03:50 +00:00
vm_zone.c Address a number of problems with sysctl_vm_zone(). 2001-04-27 22:24:45 +00:00
vm_zone.h Catch up to header include changes: 2001-03-28 09:17:56 +00:00
vm.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
vnode_pager.c Correct #includes to work with fixed sys/mount.h. 2001-04-23 09:05:15 +00:00
vnode_pager.h vnode_pager_freepage() is really vm_page_free() in disguise, 2001-04-19 06:18:23 +00:00