MFC r251872:
Be sure to actually decrement the "count" parameter for each processed
descriptor so that we return when the threshold has been reached.
Added ZFS TRIM support which is enabled by default. To disable
ZFS TRIM support set vfs.zfs.trim.enabled=0 in loader.conf.

Creating new ZFS pools and adding new devices to existing pools
first performs a full device level TRIM which can take a significant
amount of time. The sysctl vfs.zfs.vdev.trim_on_init can be set to 0
to disable this behaviour.

ZFS TRIM requires the underlying device support BIO_DELETE which
is currently provided by methods such as ATA TRIM and SCSI UNMAP
via CAM, which are typically supported by SSD's.

Stats for ZFS TRIM can be monitored by looking at the sysctl's
under kstat.zfs.misc.zio_trim.

MFC r240868: Add TRIM support
MFC r244155: Renamed zfs trim stats
MFC r244187: Upgrade TRIM free request sizes optimisation
MFC r244188: Added vfs.zfs.vdev.trim_on_init sysctl
MFC r248572: Add TRIM support for L2ARC
MFC r248573: Don't register repair writes in the trim map.
MFC r248574: Improve TXG handling in the TRIM module
MFC r248575: TRIM cache devices based on time instead of TXGs
MFC r248576: Names the ZFS TRIM thread
MFC r248577: Optimisation of TRIM processing
MFC r248602: Fix for building libzpool under i386
MFC r249921: Enabled ZFS TRIM by default
MFC 250223:
Similar to 233760 and 236717, export some more useful info about the
kernel-based POSIX semaphore descriptors to userland via procstat(1) and
fstat(1):
- Change sem file descriptors to track the pathname they are associated
  with and add a ksem_info() method to copy the path out to a
  caller-supplied buffer.
- Use ksem_info() to export the path of a semaphore via struct kinfo_file.
- Teach fstat about semaphores and to display their path, mode, and value.
MFC 251470:
Do not compare the existing mask of a cpuset with a new mask when changing
the mask of a cpuset.  Also, change the cpuset's mask before updating the
masks of all children.  Previously changing a cpuset's mask first required
setting the mask to a super-set of both the old and new masks and then
changing it a second time to the new mask.
MFC 252037: Document RA_RECURSED and RA_NOTRECURSED.
MFC 251323:
- Handle the recursed/not recursed flags with RA_RLOCKED in rw_assert().
- Tweak a panic message.
MFC r251769

  Fix setting of the Rx filters

  QEMU 1.4 made the descriptor requirement stricter - the size of buffer
  descriptor must exactly match the number of MAC addresses provided.
MFC r251945:
Pass proper memory type to free() in ata_ali_chipinit().
MFC r250377:
	Allow the use of lowercase 'yes'

PR:		bin/178422
MFC r251560

Fix a bad calloc(3) call
MFC r250613:

Fix typo in net.inet.tcp.minmss sysctl description.
MFC r252045:
Corrected ATA Passthrough defines from decimal to hex
MFC r252056:
Fix destroyed ZFS pools failing to import

MFC r252059:
Fix ZFS zpool freeze (debug command) not processing due to invalid ioctl call syntax.

MFC r252060:
Fix intermittent ZFS lock panic

MFC r252061:
Switch ZFS mutex_owner macro to use sx_xholder as its now exported via sx.h
MFC 233662,233677-233678,250418,252166:
If the firmware/BIOS assigns conflicting ranges to BARs then leaving the
BARs alone could result in one device stealing mmio accesses intended to go
to a second device.  Previously the PCI bus driver attempted to handle this
case by clearing the BAR to 0 depending on BARs based at 0 not decoding (which
is not guaranteed to be true).  Now when a conflicting BAR is detected the
following steps are taken:

 1) If hw.pci.realloc_bars (a new tunable) is enabled (default is disabled),
    then ignore the current BAR setting from the firmware and attempt to
    allocate a fresh resource range for the BAR.

 2) If 1) failed (or was disabled), disable decoding for the relevant
    BAR type (e.g. disable mem decoding for a memory BAR) and emit a
    warning if booting verbose.
MFC r250951,251838:

Ensure alq's shutdown_pre_sync event handler is deregistered on module unload to
avoid a dangling pointer and eventual panic on system shutdown.

Reported by:	Ali <comnetboy at gmail.com>
MFC r251682:

Remove some duplicate code by making KHELP_DECLARE_MOD() a wrapper around
KHELP_DECLARE_MOD_UMA().
MFC r251725:

Fix a potential NULL-pointer dereference that would trigger if the hhook
registration site did not provide storage for a copy of the hhook_head struct.
MFH (r251088, r252338): revert default privsep setting to "yes"
MFC r251887:

Add new FOREACH_FROM variants of the queue(3) FOREACH macros which can
optionally start the traversal from a previously found element by passing the
element in as "var". Passing a NULL "var" retains the same semantics as the
regular FOREACH macros.

Reviewed by:	jhb (previous version), rpaulo