freebsd-dev/module
Paul Dagnelie f09fda5071 Cap metaslab memory usage
On systems with large amounts of storage and high fragmentation, a huge 
amount of space can be used by storing metaslab range trees. Since 
metaslabs are only unloaded during a txg sync, and only if they have 
been inactive for 8 txgs, it is possible to get into a state where all 
of the system's memory is consumed by range trees and metaslabs, and 
txgs cannot sync. While ZFS knows how to evict ARC data when needed, 
it has no such mechanism for range tree data. This can result in boot 
hangs for some system configurations.

First, we add the ability to unload metaslabs outside of syncing 
context. Second, we store a multilist of all loaded metaslabs, sorted 
by their selection txg, so we can quickly identify the oldest 
metaslabs.  We use a multilist to reduce lock contention during heavy 
write workloads. Finally, we add logic that will unload a metaslab 
when we're loading a new metaslab, if we're using more than a certain 
fraction of the available memory on range trees.

Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #9128
2019-08-16 09:08:21 -06:00
..
avl Update build system and packaging 2018-05-29 16:00:33 -07:00
icp Minor style cleanup 2019-07-16 17:22:31 -07:00
lua Fix channel programs on s390x 2019-07-28 18:15:26 -07:00
nvpair Use NV_ENCODE_NATIVE for nvlist encoding variable 2019-04-26 11:24:31 -07:00
spl Drop KMC_NOEMERGENCY 2019-08-13 07:46:12 -06:00
unicode Update build system and packaging 2018-05-29 16:00:33 -07:00
zcommon Fast Clone Deletion 2019-07-26 10:54:14 -07:00
zfs Cap metaslab memory usage 2019-08-16 09:08:21 -06:00
.gitignore Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
Makefile.in Fix out-of-tree build failures 2019-06-24 09:32:47 -07:00