mirror_zfs/contrib
Paul Dagnelie 26983d6fa7 Add allocation profile export and zhack subcommand for import
When attempting to debug performance problems on large systems, one of
the major factors that affect performance is free space
fragmentation. This heavily affects the allocation process, which is an
area of active development in ZFS. Unfortunately, fragmenting a large
pool for testing purposes is time consuming; it usually involves filling
the pool and then repeatedly overwriting data until the free space
becomes fragmented, which can take many hours. And even if the time is
available, artificial workloads rarely generate the same fragmentation
patterns as the natural workloads they're attempting to mimic.

This patch has two parts. First, in zdb, we add the ability to export
the full allocation map of the pool. It iterates over each vdev,
printing every allocated segment in the ms_allocatable range tree. This
can be done while the pool is online, though in that case the allocation
map may actually be from several different TXGs as new ones are loaded
on demand.

The second is a new subcommand for zhack, zhack metaslab leak (and its
supporting kernel changes). This is a zhack subcommand that imports a
pool and then modified the range trees of the metaslabs, allowing the
sync process to write them out normall. It does not currently store
those allocations anywhere to make them reversible, and there is no
corresponding free subcommand (which would be extremely dangerous); this
is an irreversible process, only intended for performance testing. The
only way to reclaim the space afterwards is to destroy the pool or roll
back to a checkpoint.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #17576
2025-09-10 15:01:28 -07:00
..
bash_completion.d Updating bash completion build file 2024-08-08 15:39:25 -07:00
bpftrace Replace EXTRA_DIST with dist_noinst_DATA 2022-05-26 09:24:50 -07:00
coverity Coverity Model Update 2022-11-29 10:00:56 -08:00
debian contrib/debian: install files into merged /usr 2025-09-10 15:01:24 -07:00
dracut dracut: support mountpoint=legacy for root dataset 2023-08-08 09:38:34 -07:00
icp/gcm-simd/boringssl Backport AVX2 AES-GCM implementation from BoringSSL 2025-08-13 14:51:20 -07:00
initramfs Prompt user to unlock when login from dropbear 2025-09-09 17:03:22 -07:00
intel_qat Add intel_QAT patches 2020-09-30 13:17:30 -07:00
pam_zfs_key Update pam_zfs_key.c defaultt path for FreeBSD 2025-09-09 17:04:06 -07:00
pyzfs Add allocation profile export and zhack subcommand for import 2025-09-10 15:01:28 -07:00
zcp Replace EXTRA_DIST with dist_noinst_DATA 2022-05-26 09:24:50 -07:00
Makefile.am Fix missing packaging files from release tarballs 2024-10-04 11:18:08 -07:00