kernel - Fix network lockup due to msgport bug

* Netisr threads (i.e. arp thread) which issue route table updates
  use a synchronous netmsg from a 'spin' type port to a 'thread' type
  port.

  When going spin->thread, the lwkt_thread_putport*() code was not
  using an atomic op to manipulate ms_flags.  This could interfere
  with the originator on the spin port issuing a lwkt_spin_waitmsg()
  and cause one or more flags to be lost.

  Ensure that lwkt_thread_putport*() uses atomic ops when manipulating
  ms_flags.

* Another serious issue is that the lwkt_*_waitmsg() code was testing
  MSGF_QUEUED outside of its port lock.  This flag can only be tested
  while the port is locked.

* lwkt_thread_replyport() must use an atomic op when setting
  MSGF_INTRANSIT and MSGF_REPLY to avoid SMP races on ms_flags
  updates.

* lwkt_thread_replyport() requires a critical section against
  possible preemption when adjusting ms_flags.

* lwkt_forwardmsg() does not need a critical section.

* Other notes: Not all ms_flags manipulation needs an atomic op.  For
  example, when initializing a new message or when a lock is held to
  rendezvous at a reply port when replying.  However, all 'put' and 'wait'
  interactions on messages absolutely require atomic ops when manipulating
  ms_flags.

  Finally, note that all msgport queue operations use atomic ops to
  adjust MSGF_QUEUED when adding or removing a message to a port queue.
kernel - Add frontend cache for cache_findmount()

* When a name lookup crosses a mount point boundary it must call
  cache_findmount() to locate the mount linkage.  This linkage is
  not stored in the vp or ncp because there is a 1:N relationship
  between vp/ncp and possible mounts due to DragonFly's ability
  to do arbitrary nullfs mounts in the topology.

* The mountlist scan requires an exclusive token to deal with ripouts
  during the scan.  This creates a bottleneck when highly parallel
  filesystem operations are being run on the machine and use mount-crossing
  paths or absolute paths.

* The frontend cache is able to use a shared spinlock for the fast path,
  and implements a simple non-chained linear array hashed by pointer
  values.
kernel - Fix performance issue due to buffer fragmentation

* Systems with a lot of memory have very large buffer pools.  Defragmenting
  these pools can be expensive.  Often the buffer_map becomes full well
  before the bufspace actually hits its limits.  Filesystems such as HAMMER
  which use large buffer sizes (64K) are more likely to cause the problem.

  The result is extremely bad I/O performance for data not in the buffer
  cache which requires a new buffer to be instantiated.

* To solve this we double the size of the buffer_map's KVA area on
  64-bit systems while leaving the maximum buffer space allowed the
  same.  The larger virtual space greatly reduces KVA allocation
  failures due to fragmentation.

* This solves significant performance issues on monster with its 64G
  of ram, but should improve performance on any 64-bit system by
  reducing buffer cache defrag iterations.

* Also fix a possible intermediate value overflow in vlrureclaim().
altq/hfsc: Fix wrong malloc size

Reported-by: pavalos@