diff options
author | Brian Behlendorf <[email protected]> | 2021-11-30 10:38:09 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2021-11-30 10:38:09 -0800 |
commit | 05b3eb6d232009db247882a39d518e7282630753 (patch) | |
tree | 45618ab04bf1fb5c082f46476289e433462ab713 /module/zfs | |
parent | 5dc6fc2b73bffd9876374260e7840cc1177bf726 (diff) |
Default to zfs_dmu_offset_next_sync=1
Strict hole reporting was previously disabled by default as a
performance optimization. However, this has lead to confusion
over the expected behavior and a variety of workarounds being
adopted by consumers of ZFS. Change the default behavior to
always report holes and force the TXG sync.
Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #12746
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/dmu.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index eee3e70bb..5ce11e86d 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -73,9 +73,13 @@ int zfs_nopwrite_enabled = 1; unsigned long zfs_per_txg_dirty_frees_percent = 5; /* - * Enable/disable forcing txg sync when dirty in dmu_offset_next. + * Enable/disable forcing txg sync when dirty checking for holes with lseek(). + * By default this is enabled to ensure accurate hole reporting, it can result + * in a significant performance penalty for lseek(SEEK_HOLE) heavy workloads. + * Disabling this option will result in holes never being reported in dirty + * files which is always safe. */ -int zfs_dmu_offset_next_sync = 0; +int zfs_dmu_offset_next_sync = 1; /* * Limit the amount we can prefetch with one call to this amount. This @@ -2107,8 +2111,8 @@ restart: * If the zfs_dmu_offset_next_sync module option is enabled * then strict hole reporting has been requested. Dirty * dnodes must be synced to disk to accurately report all - * holes. When disabled (the default) dirty dnodes are - * reported to not have any holes which is always safe. + * holes. When disabled dirty dnodes are reported to not + * have any holes which is always safe. * * When called by zfs_holey_common() the zp->z_rangelock * is held to prevent zfs_write() and mmap writeback from |