zfs/include
Serapheim Dimitropoulos 928e8ad47d Introduce auxiliary metaslab histograms
This patch introduces 3 new histograms per metaslab. These
histograms track segments that have made it to the metaslab's
space map histogram (and are part of the spacemap) but have
not yet reached the ms_allocatable tree on loaded metaslab's
because these metaslab's are currently syncing and haven't
gone through metaslab_sync_done() yet.

The histograms help when we decide whether to load an unloaded
metaslab in-order to allocate from it. When calculating the
weight of an unloaded metaslab traditionally, we look at the
highest bucket of its spacemap's histogram.  The problem is
that we are not guaranteed to be able to allocated that
segment when we load the metaslab because it may still be at
the freeing, freed, or defer trees. The new histograms are
used when we try to calculate an unloaded metaslab's weight
to deal with this issue by removing segments that have would
not be in the allocatable tree at runtime. Note, that this
method of dealing with this is not completely accurate as
adjacent segments are not always consolidated in the space
map histogram of a metaslab.

In addition and to make things deterministic, we always reset
the weight of unloaded metaslabs based on their space map
weight (instead of doing that on a need basis). Thus, every
time a metaslab is loaded and its weight is reset again (from
the weight based on its space map to the one based on its
allocatable range tree) we expect (and assert) that this
change in weight can only get better if it doesn't stay the
same.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #8358
2019-02-20 09:59:56 -08:00
..
linux Linux 5.0 compat: Disable vector instructions on 5.0+ kernels 2019-01-28 10:11:45 -08:00
spl Linux 4.20 compat: Fix VERIFY(RW_READ_HELD(&hash->mh_contents)) 2019-02-15 12:37:20 -08:00
sys Introduce auxiliary metaslab histograms 2019-02-20 09:59:56 -08:00
.gitignore Create /proc/sys/kernel/spl/gitrev with git hash 2018-10-08 21:57:02 -07:00
Makefile.am Add libzutil for libzfs or libzpool consumers 2018-11-05 11:22:33 -08:00
libnvpair.h Add JSON output support to channel programs 2018-03-19 12:40:58 -07:00
libuutil.h Correct cppcheck errors 2017-09-19 12:17:29 -07:00
libuutil_common.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libuutil_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libzfs.h zfs should optionally send holds 2019-02-15 12:41:38 -08:00
libzfs_core.h OpenZFS 9102 - zfs should be able to initialize storage devices 2019-01-07 10:37:26 -08:00
libzfs_impl.h OpenZFS 8115 - parallel zfs mount 2018-11-15 11:33:58 -08:00
libzutil.h Fix libudev dependency in libzutil 2018-11-06 17:47:52 -08:00
thread_pool.h Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
zfeature_common.h Defer new resilvers until the current one ends 2018-10-18 21:06:18 -07:00
zfs_comutil.h OpenZFS 9337 - zfs get all is slow due to uncached metadata 2018-07-12 10:49:27 -07:00
zfs_deleg.h OpenZFS 7614, 9064 - zfs device evacuation/removal 2018-04-14 12:16:17 -07:00
zfs_fletcher.h DLPX-44812 integrate EP-220 large memory scalability 2016-11-29 14:34:27 -08:00
zfs_namecheck.h OpenZFS 9330 - stack overflow when creating a deeply nested dataset 2018-07-09 13:02:50 -07:00
zfs_prop.h Add zfs module feature and property info to sysfs 2018-09-02 12:09:53 -07:00