kernel - Implement vm.read_shortcut support in tmpfs

* Implement tmpfs support for vm.read_shorcut_enable=1

* Approximately doubles tmpfs read() performance on 64-bit systems
  for data sets which exceed the size of the buffer cache.

  Example using monster (64G ram, 6.4G buffer cache, 9G test data set)

    du -s -k /mp
	9037196 /mp

    sysctl vm.read_shortcut_enable=1
    time tar cf /dev/nmonster# time tar cf /dev/null /mp
	6.763u 13.275s 0:20.05 99.9%    26+66k 0+0io 0pf+0w
	7.224u 12.830s 0:20.07 99.9%    26+66k 0+0io 0pf+0w
	6.957u 14.924s 0:21.91 99.8%    26+66k 0+0io 0pf+0w

    sysctl vm.read_shortcut_enable=0
    time tar cf /dev/nmonster# time tar cf /dev/null /mp
	7.510u 23.997s 0:31.52 99.9%    26+66k 0+0io 0pf+0w
	7.769u 37.738s 0:45.53 99.9%    25+65k 0+0io 0pf+0w
	7.716u 40.306s 0:48.04 99.9%    25+65k 0+0io 0pf+0w

* Note that variations in run time when the feature is disabled
  depends on what data is already present in the buffer cache and
  the cost of mapping new buffers and tearing down old buffers.
  This can be substantial on large multi-way systems due to
  SMP/page-table issues.
kernel - Fix excessive kprintf()s during refcount_wait()

* _refcount_wait() can do itself in with excessive kprintf()s
  on large multi-way machines, causing the machine to become
  unresponsive.

* Rewrite the code to use a ticks test and only kprintf()
  a warning when it takes more than 60 seconds.

* Used by vm_object_pip_wait().  Long I/O queues are possible.
kernel - Fix cpu/token starvation, vfs_busy deadlocks. incls sysctl (2)

* Last commit had a bug in the deadlock fix for nlookup().  This fix
  is tested and works.
igb: Fix timer cpuid settings when entering/exiting polling mode
bce: Fix tick/pulse callout target CPU setting
asr(4): Remove a case that is not a member of the enum being tested.

Apparently xpt_opcode can wind up being REPORT_LUNS here. gcc47 warns
about it because REPORT_LUNS is not an enum xpt_opcode member.

FreeBSD just casted this away. Instead of doing that, remove it and
let the default case handle it (which has the same code as XPT_ABORT).

While here, fix a typo in a comment.
kernel - Add critical section in lwkt_yield_quick()

* Add a critical section to protect the clearing of the LWKT reschedule
  bit against gd_tdrunq.
kernel - Fix issue with ARP packets stalling out entire network

* ARP packets can cause ARP routing table updates to occur.  An ARP
  routing table update is an expensive synchronous netmsg that is
  forwarded through *ALL* cpus.

* ARP was previously being handled by netisr 0 and on large multi-way
  machines (aka monster the 48-way opteron) under very heavy loads this
  could result in very long stalls for any packet processing forwarded
  to cpu 0.

  Stalls exceeding 200 seconds were observed on monster when a large
  number of ARP packets had to be processed.

* Implement a dedicated thread feature for the NETISR mechanism and
  modify NETISR_ARP to use it.  This takes the expensive synchronous
  ARP packet processing off the general per-cpu netisr threads.
  This thread currently runs on cpu (18 % ncpus) (NETISR_ARP == 18).

  Thus the general per-cpu (netisr 0) thread will no longer stall
  on ARP packets.

* ping latencies under extreme loads improved to (approximately):

  ping -i 0.001 monster-nr
  11735 packets transmitted, 11735 packets received, 0.0% packet loss
  round-trip min/avg/max/stddev = 0.073/0.190/27.019/0.382 ms
vkernel - Settable serial numbers for virtual disks.

  User can specify now serial numbers for their virtual disks
  from the command line.

  Example:
	./vkernel -m 128m -r root.img:VKDMYSERNO
vkernel(7) - Minor manpage adjustments.
vke(4) - Show backing tap only if one was used.
vkd(4) - Announce virtual disks upon initialization.
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@
bce: Free serializer array in detach path
bce: Move RX serializers before TX serializers

RX serializers will be use to protect MSI-X
kernel - Increase NCMOUNT_NUMCACHE, add enable & statistics

* Increase NCMOUNT_NUMCACHE to 1009 (prime number), change to modulo.
  This cache improves long namecache path lookups.

* Add enable and statistics.  Cache defaults to enabled.

    debug.ncmount_cache_enable	(defaults to 1)
    debug.ncmount_cache_hit
    debug.ncmount_cache_miss
    debug.ncmount_cache_overwrite
kernel - Add negative caching to cache_findmount()

* Add negative caching to cache_findmount().  It turns out that there
  are quite a few cases, particularly during poudriere, so this is
  needed to avoid dropping down into the slow mountlist scan code.

* Removes remaining bottlenecks in mount-point crossings during path
  lookups.  The mountlist_token is no longer colliding in critical
  paths.