diff options
author | Paul Dagnelie <[email protected]> | 2022-08-22 12:36:22 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2022-08-22 12:36:22 -0700 |
commit | 17e212652db34d2942d6aa42ba14b443bcd73bea (patch) | |
tree | 842a7c17a4f8cbb0c99223942f0352028c06f145 /module/zfs/dsl_destroy.c | |
parent | d22dd77c4d4556373b995121412c4abac02bcf8a (diff) |
Prevent zevent list from consuming all of kernel memory
There are a couple changes included here. The first is to introduce
a cap on the size the ZED will grow the zevent list to. One million
entries is more than enough for most use cases, and if you are
overflowing that value, the problem needs to be addressed another
way. The value is also tunable, for those who want the limit to be
higher or lower.
The other change is to add a kernel module parameter that allows
snapshot creation/deletion to be exempted from the history logging;
for most workloads, having these things logged is valuable, but for
some workloads it produces large quantities of log spam and isn't
especially helpful.
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Issue #13374
Closes #13753
Diffstat (limited to 'module/zfs/dsl_destroy.c')
-rw-r--r-- | module/zfs/dsl_destroy.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/module/zfs/dsl_destroy.c b/module/zfs/dsl_destroy.c index 778b6b99b..100a48cb4 100644 --- a/module/zfs/dsl_destroy.c +++ b/module/zfs/dsl_destroy.c @@ -49,6 +49,8 @@ #include <sys/zthr.h> #include <sys/spa_impl.h> +extern int zfs_snapshot_history_enabled; + int dsl_destroy_snapshot_check_impl(dsl_dataset_t *ds, boolean_t defer) { @@ -321,14 +323,19 @@ dsl_destroy_snapshot_sync_impl(dsl_dataset_t *ds, boolean_t defer, dmu_tx_t *tx) ASSERT(spa_version(dp->dp_spa) >= SPA_VERSION_USERREFS); dmu_buf_will_dirty(ds->ds_dbuf, tx); dsl_dataset_phys(ds)->ds_flags |= DS_FLAG_DEFER_DESTROY; - spa_history_log_internal_ds(ds, "defer_destroy", tx, " "); + if (zfs_snapshot_history_enabled) { + spa_history_log_internal_ds(ds, "defer_destroy", tx, + " "); + } return; } ASSERT3U(dsl_dataset_phys(ds)->ds_num_children, <=, 1); - /* We need to log before removing it from the namespace. */ - spa_history_log_internal_ds(ds, "destroy", tx, " "); + if (zfs_snapshot_history_enabled) { + /* We need to log before removing it from the namespace. */ + spa_history_log_internal_ds(ds, "destroy", tx, " "); + } dsl_scan_ds_destroyed(ds, tx); |