mirror_zfs/tests/zfs-tests/tests/functional
Paul Dagnelie 8f15d2e4d5 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 11:13:24 -07:00
..
acl SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
alloc_class Relax special_small_blocks restrictions 2025-07-02 11:11:37 -07:00
append SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
arc SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
atime SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bclone ioctl: remove FICLONE/FICLONERANGE/FIDEDUPERANGE compat 2025-05-08 10:32:52 -04:00
block_cloning Default to zfs_bclone_wait_dirty=1 2025-07-25 10:42:23 -04:00
bootfs SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
btree SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
cache SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
cachefile SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
casenorm SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
channel_program ZTS: test zfs.sync.clone() for filesystems and volumes 2025-06-10 14:53:15 -07:00
chattr SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
checksum SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
clean_mirror SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
cli_root Add allocation profile export and zhack subcommand for import 2025-09-10 11:13:24 -07:00
cli_user cmd: rename arcstat to zarcstat 2025-09-10 10:45:21 -07:00
compression SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
cp_files Default to zfs_bclone_wait_dirty=1 2025-07-25 10:42:23 -04:00
crtime SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
crypto SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
ctime SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
deadman SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dedup ZTS: Remove ashift setting from dedup_quota test (#17250) 2025-04-18 14:42:52 -07:00
delegate SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
devices SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
direct ZTS: Enable io_uring support on el9/el10 2025-05-30 13:57:35 -07:00
dos_attributes SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
events ZTS: Fix 256MB file leak in zed_cksum_reported 2025-04-23 21:08:39 -04:00
exec SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
fadvise FreeBSD: Add posix_fadvise(POSIX_FADV_WILLNEED) support 2025-05-29 09:34:07 -04:00
failmode ZTS: test response of various sync methods under different failmodes 2025-08-08 16:42:35 -07:00
fallocate SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
fault ZTS: Fix fault_limits timeouts 2025-09-09 13:42:01 -07:00
features SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
gang_blocks Improve and fix gang blocks dyn header test 2025-08-06 09:50:24 -07:00
grow SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
history SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
hkdf SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
idmap_mount SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
inheritance SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
inuse SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
io ZTS: Enable io_uring support on el9/el10 2025-05-30 13:57:35 -07:00
l2arc SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
large_files SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
largest_pool SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
limits SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
link_count SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
log_spacemap SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
longname SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
luks SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
migration SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mmap ZTS: mmap_ftruncate test to confirm async writeback behaviour 2025-08-06 09:54:05 -07:00
mmp SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mount ZTS: add mount_loopback to test zfs behind loop dev 2025-08-25 11:20:46 -07:00
mv_files SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
nestedfs SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
no_space SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
nopwrite SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
online_offline ZTS: Restore some delays in online_offline tests 2025-05-02 15:19:24 -07:00
pam SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
pool_checkpoint Fix zdb pool/ with -k 2025-07-15 17:01:49 -07:00
pool_names SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
poolversion SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
privilege SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
procfs SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
projectquota zts: add spdx license tags to default_quota tests 2025-04-03 10:37:09 -07:00
pyzfs SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
quota SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
raidz SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
redacted_send SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
redundancy SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
refquota SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
refreserv SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
removal SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
rename_dirs SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
renameat2 SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
replacement ZTS: Fix replacement/resilver_restart_001 on FreeBSD 2025-05-02 12:02:14 -04:00
reservation SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
rootpool SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
rsend ZTS: testing for leaked key mappings in encrypted non-raw send 2025-05-23 21:46:51 -04:00
scrub_mirror SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
simd SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
slog ZTS: Remove fixed sleeps from slog_006_pos 2025-04-22 21:03:52 -04:00
snapshot SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
snapused SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sparse SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
stat Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
suid SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
syncfs zts: test syncfs() behaviour when pool suspends 2025-06-12 14:39:35 -07:00
tmpfile SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
trim SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
truncate SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
upgrade SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
user_namespace SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
userquota zts: add spdx license tags to default_quota tests 2025-04-03 10:37:09 -07:00
vdev_disk Multiple printf() size fixes (#17199) 2025-04-01 15:27:03 -07:00
vdev_zaps SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
write_dirs SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
xattr SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zap_shrink SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zpool_influxdb SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zvol ZTS: stress test concurrent zvol create/destroy 2025-08-19 10:05:34 -07:00