From 1ef706c4ad1d981537ee17b686d94878132284b5 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 24 Apr 2025 19:31:10 -0400 Subject: [PATCH] ZTS: Reduce extra caching in pool_checkpoint (#17268) Those tests are write-mostly at the nested pool. Considering we have 3 more layers of caching underneath, we can hint ZFS how to use the memory better by setting primarycache=metadata. While there, add missing zpool sync after rm in checkpoint_capacity before we could potentially see the freed space, would not there be a pool checkpoint. Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Reviewed-by: Tino Reichardt Reviewed-by: Tony Hutter --- .../tests/functional/pool_checkpoint/checkpoint_capacity.ksh | 5 +++-- .../tests/functional/pool_checkpoint/pool_checkpoint.kshlib | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_capacity.ksh b/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_capacity.ksh index 3585fbee4..897956456 100755 --- a/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_capacity.ksh +++ b/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_capacity.ksh @@ -60,14 +60,15 @@ log_must set_tunable32 SPA_ASIZE_INFLATION 4 log_must zfs create $DISKFS log_must mkfile $FILEDISKSIZE $FILEDISK1 -log_must zpool create $NESTEDPOOL $FILEDISK1 +log_must zpool create -O primarycache=metadata $NESTEDPOOL $FILEDISK1 -log_must zfs create -o compression=lz4 -o recordsize=8k $NESTEDFS0 +log_must zfs create $NESTEDFS0 log_must dd if=/dev/urandom of=$NESTEDFS0FILE bs=1M count=700 FILE0INTRO=$(head -c 100 $NESTEDFS0FILE) log_must zpool checkpoint $NESTEDPOOL log_must rm $NESTEDFS0FILE +log_must sync_pool $NESTEDPOOL # # only for debugging purposes diff --git a/tests/zfs-tests/tests/functional/pool_checkpoint/pool_checkpoint.kshlib b/tests/zfs-tests/tests/functional/pool_checkpoint/pool_checkpoint.kshlib index ce9fefb9d..4e8e51077 100644 --- a/tests/zfs-tests/tests/functional/pool_checkpoint/pool_checkpoint.kshlib +++ b/tests/zfs-tests/tests/functional/pool_checkpoint/pool_checkpoint.kshlib @@ -139,7 +139,8 @@ function setup_nested_pool log_must truncate -s $DISKSIZE $FILEDISK1 log_must truncate -s $DISKSIZE $FILEDISK2 - log_must zpool create -O sync=disabled $NESTEDPOOL $FILEDISKS + log_must zpool create -O primarycache=metadata -O sync=disabled \ + $NESTEDPOOL $FILEDISKS } function setup_test_pool