kernel - Change namecache negative caching algorithm

* Use desiredvnodes instead of numcache (current number of namecache
  entries) to scale the number of negative cache entries.

  This allows for more negative cache entries and no longer has
  degenerate situations when the value of numcache is low.

* namecache entries are still cleaned up in the critical namecache
  paths, but vnlru() now also cleans up the namecache when it exceeds
  80% of its nominal maximum.  The result is that the namecache is
  kept under better control AND the cleanups are generally able to be
  handled by vnlru() and do not effect the critical paths.

* Huge improvement in poudriere during concurrent python easy_install
  execution.  The python easy_install performs horribly without sufficient
  negative caching.  This fixes that.

Reported-by: thesjg
kernel - Fix tmpfs hogging of the VM system

* tmpfs pretty much bypasses the buffer cache's normal clean/dirty
  handling.  Add appropriate VM paging wait states to prevent
  tmpfs operations from hogging free memory and causing other processes
  to stall for long periods of time in low memory situations.
kernel - Abort pageout operations when free memory recovers

* Nominal pageout operations free memory.  On systems with large amounts
  of ram the pageout count can be very large and take a long time to
  clear.  During this period, other unrelated processes might free memory.
  But even when sufficient memory is freed the pageout daemon still tries
  to finish clearing its previously calculated number of pages.

* Add a check in the deactivation scan to break out of the loop if
  a sufficient number of free pages is detected.

* Fixes unnecessary extra paging out of data (which can go on for several
  minutes) on large systems when memory is freed by other means.
kernel - Add swap block allocation iterator

* Instead of allocating the first available block the swap allocator
  now has an iterator and attempts to allocate a block near the iterator.
  On failure the iterator resets to the beginning of swap (0) and it
  tries again.

* This theoretically should result in more linearized allocations of
  swap space, allowing the pageout daemon to flush memory to a
  hard-drive-based swap at much higher bandwidth.

* Greatly improves poudriere when using stressful memory parameters,
  at least in the first pass.

* There are still some obvious linearity issues that can occur once
  the iterator recycles back to 0 which need to be addressed.  However,
  this change is certainly not going to be worse and should
  prevent degenerative swap situations where performance winds up
  being permanently bad due to fragmented data laid down earlier that
  is never paged back into memory.
kernel - Make VM fault waits in low memory the same as other low memory waits

* Nominal memory allocations, particularly by tmpfs, allow allocations
  down to the 'min' before waiting for memory to recover to 'target'.
  The VM fault code required memory to be at or above the 'target'
  at all times.  This led to extreme starvation because other user-accessible
  subsystems could force free memory to remain below 'target'.

* Change the VM code to use substantially the same down-to 'min' and
  recover-to 'target' parameters that other subsystems use.  This
  should reduce the excessive stalls under low memory conditions.

* Rename vm_waitpfault() to vm_wait_pfault() to conform with other
  naming schemes in the same API.
kernel - Refactor swapoff scan code

* Refactor the scan code to be far more optimal.  The old scan was
  restarting the entire VM object scan on each swap block removed
  from the swap device being turned off.

* Scan twice before giving up to try to catch any elements which
  are in-transition.
kernel - Improve vm.vmmeter sysctl performance

* Improve performance by reducing the rate at which the marker is moved.

* Fix a bug, noting that lwkt_yield() can cause us to lose the token,
  by always using the marker for both it and the collision case.
kernel/arpresolve: Initialize 'rt' with NULL.

This fixes a case where NULL was passed for 'rt0' and 'rt' could end up
uninitialized at the log() call in line 509.

Review by sephe showed that we never pass NULL as 'rt0' but let's fix it
anyway, to be safer.

Reported-by: enroljas
Reviewed-by: sephe
kernel/tmpfs: Add missing include for vm_wait_nominal() prototype.
kernel: Use our offsetof() from <sys/types.h> instead of a local one.

On GCC 4.1 and later, our offsetof() winds up being __builtin_offsetof(),
which is constant to GCC, so as a nice benefit this commit also fixes two
GCC 4.7 warnings:

.../dirhash.h:97:95: warning: variably modified 'dh_firstfree' at file scope
.../vdevice.h:145:2: warning: variably modified '_ArrayTables' at file scope

There are more offsetof() candidates I need to get to but since those two
fix warnings, I commit them now.
Merge branch 'master' into gsocdrm_merger
kernel/ufs: Use __offsetof() instead of offsetof() (unbreaks buildworld).

__offsetof() is known to userland too, and <vfs/ufs/dir.h> is shared with
some userland programs.

Reported-by: marino
Merge branch 'master' into gsocdrm_merger
kernel - Increase size of savefpu area in pcb for vkernel64

* The vkernel64 uses bcopy.  The ucontext_t/mcontext_t reserves a 1024
  byte space for the fpu area, but the savefpu structure only reserves
  834 bytes.  Increase the savefpu structure appropriately.

* Did not effect real 64-bit kernels because they used machine instructions
  to save/restore the FP state and/or bcopy'd using the savefpu structure
  sdize instead of the size of the fpu area in the ucontext/mcontext
  structure.

* Fixes panics in vkernel64

Reported-by: tuxillo
Merge branch 'master' into gsocdrm_merger