Limit default maximum blocks to be freed in one single transaction
group, vfs.zfs.free_max_blocks at 131072 blocks (=512M @ 4k block size,
or =16GiB @ 128k block size).  This helps to prevent foot shooting for
destroying large datasets.
MFV r272493:

Show individual disk capacity when doing zpool list -v.

Illumos issue:
    5147 zpool list -v should show individual disk capacity

MFC after:	1 week

(cherry picked from commit 33caf06b8f97faa86800b3207971b177f5a78fc5)
MFV r272494:

Make space_map_truncate() always do space_map_reallocate().  Without
this, setting space_map_max_blksz would cause panic for existing pool,
as dmu_objset_set_blocksize would fail if the object have multiple blocks.

Illumos issues:
   5164 space_map_max_blksz causes panic, does not work
   5165 zdb fails assertion when run on pool with recently-enabled
	spacemap_histogram feature

MFC after:	2 weeks

(cherry picked from commit 64595536f12e0c6835b51d11556e9fda8cc7596d)
MFV r272495:

In arc_kmem_reap_now(), reap range_seg_cache too to reclaim memory in
response of memory pressure.

Illumos issue:
    5163 arc should reap range_seg_cache

MFC after:	1 week

(cherry picked from commit 3dd244b4585ee134de54a563e36294f12da835a5)
Don't make nested definition for range_seg_cache.

Reported by:	ian
MFC after:	1 week
X-MFC-With:	r272506

(cherry picked from commit 60bf73506ecd9b277bfeb5eaa63fa80715d98698)
MFV r272496:

Add tunable for number of metaslabs per vdev
(vfs.zfs.vdev.metaslabs_per_vdev).  The default remains
at 200.

Illumos issue:
    5161 add tunable for number of metaslabs per vdev

MFC after:	2 weeks

(cherry picked from commit 096b5dca2146c061317f69289592b55c29e33c20)
Diff reduction with upstream.  The code change is not really applicable
to FreeBSD.

Illumos issue:
    5148 zvol's DKIOCFREE holds zfsdev_state_lock too long

MFC after:	1 month

(cherry picked from commit cd42e24ad69c0a9ba1e765d5401cfc7739996fc5)
Add a new sysctl, vfs.zfs.vol.unmap_enabled, which allows the system
administrator to toggle whether ZFS should ignore UNMAP requests.

Illumos issue:
    5149 zvols need a way to ignore DKIOCFREE

MFC after:	2 weeks

(cherry picked from commit 8bbc3504dc7ab4846f39c308c7df786d8e105fd9)
MFV r272499:

Illumos issue:
    5174 add sdt probe for blocked read in dbuf_read()

MFC after:	2 weeks

(cherry picked from commit 87516a919a377c41145bcbb6d0b7f9b69d15c658)
MFV r272500:

Don't inherit flags other than DS_FLAG_CI_DATASET and DS_FLAG_INCONSISTENT
when cloning.  This prevents DS_FLAG_DEFER_DESTROY being inherited from a
clone that is marked for deferred destroy, which causes snapshots of the
clone being destroyed when getting a hold or clone.

Illumos issue:
    5150 zfs clone of a defer_destroy snapshot causes strangeness

MFC after:	1 week

(cherry picked from commit bd5e6432da9c175a419ce63c6835ec5e61a58451)
MFV r272501:

Illumos issue:
    5177 remove dead code from dsl_scan.c

MFC after:	2 weeks

(cherry picked from commit 37185e7390a0c255ae105ae62e8e8135235f9367)
MFV r272585:

Split the godfather zio into CPU number's to reduce lock
contention.

Illumos issue:
    5176 lock contention on godfather zio

MFC after:	2 weeks

(cherry picked from commit 3f54b74af40b22333965b536b8a9aad1dba482e9)
MFV r272588:

Handle old format deadlist.

Illumos issue:
    5178 zdb -vvvvv on old-format pool fails in dump_deadlist()

MFC after:	2 weeks

(cherry picked from commit 72b086c52ce1483b4a1a258fce3db32ce687df75)
MFV r272591:

Use loaned ARC buffer for zfs receive to avoid copy.

Illumos issue:
    5162 zfs recv should use loaned arc buffer to avoid copy

MFC after:	2 weeks

(cherry picked from commit 004a50f8bdd69852eaf09dfea3316483d61f950a)
make userland __assfail from opensolaris compat honor 'aok' variable

This should allow zdb -A option to actually make difference.

MFC after:	2 weeks

(cherry picked from commit 073bd9bd13425e6588e77bb94607bc4fea41ba02)
l2arc_write_buffers: reduce headroom value

FreeBSD has ARC_BUFC_NUMMETADATALISTS metadata lists and ARC_BUFC_NUMDATALISTS
data lists (currently both are 16) while illumos has just a single list
of each kind.

headroom determines how much data is scanned on a single list
during each run of the l2arc feed thread.
Because FreeBSD has more lists we proportionally decrease the limit.

Reviewed by:	Brendan Gregg (earlier version)
MFC after:	2 weeks
Sponsored by:	HybridCluster

(cherry picked from commit e2d6ebec55f41f7360a1479231b139957f19dc26)
MFV r272802:

 - Limit ARC for zdb at 256MB.  zdb do not typically revisit data
   in the ARC.
 - Increase default max_inflight from 200 to 1000 (can be overriden
   by -I) so we can queue more I/Os when doing scrubbing.
 - Print status while loading meataslabs for leak detection.

Illumos issues:

    5169 zdb should limit its ARC size
    5170 zdb -c should create more scrub i/os by default
    5171 zdb should print status while loading metaslabs for leak detection

MFC after:	2 weeks

(cherry picked from commit 80ce4ebd6fc32e4da5926785ee81126f7bdb4a25)
MFV r272803:

Illumos issue:
    5175 implement dmu_read_uio_dbuf() to improve cached read performance

MFC after:	2 weeks

(cherry picked from commit 85c930be77ff3a540ef399a863b3519247b12468)
MFV r272804:

Refactor the code and stop restore_object from creating two transactions.

Illumos issue:
    3693 restore_object uses at least two transactions to restore an object

MFC after:	2 weeks

(cherry picked from commit 0dc921b9429b9b35ae5ac9bf3ce2afc06d050053)
Add tunable vfs.zfs.space_map_blksz for space map's maximum block size.

MFC after:	2 weeks

(cherry picked from commit 5165eb29732afe97f688263f6b85d672c8c00f12)