From 154e48eac904dc8e4d46c8f74f0ce50dd0e94697 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Thu, 30 Apr 2020 20:48:58 -0400 Subject: [PATCH] zdb: Fix ignored zfs_arc_max tuning Running zdb -l $disk shows a warning that zfs_arc_max is being ignored. zdb sets zfs_arc_max below zfs_arc_min, which causes the value to be ignored by arc_tuning_update(). Set zfs_arc_min to the bare minimum in zdb, which is below zfs_arc_max. Reviewed by: Brian Behlendorf Reviewed-by: Allan Jude Reviewed-by: Matthew Ahrens Reviewed-by: George Melikov Signed-off-by: Ryan Moeller Closes #10269 --- cmd/zdb/zdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index f5492666f1..f4b4b454b4 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -100,7 +100,7 @@ zdb_ot_name(dmu_object_type_t type) extern int reference_tracking_enable; extern int zfs_recover; -extern uint64_t zfs_arc_max, zfs_arc_meta_limit; +extern uint64_t zfs_arc_min, zfs_arc_max, zfs_arc_meta_min, zfs_arc_meta_limit; extern int zfs_vdev_async_read_max_active; extern boolean_t spa_load_verify_dryrun; extern int zfs_reconstruct_indirect_combinations_max; @@ -7414,6 +7414,7 @@ main(int argc, char **argv) * ZDB does not typically re-read blocks; therefore limit the ARC * to 256 MB, which can be used entirely for metadata. */ + zfs_arc_min = zfs_arc_meta_min = 2ULL << SPA_MAXBLOCKSHIFT; zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024; #endif