Permalink
Browse files

OpenZFS 9963 - Separate tunable for disabling ZIL vdev flush

Authored by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Ported-by: Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/9963
OpenZFS-commit: openzfs/openzfs@f8fdf68
  • Loading branch information...
prakashsurya authored and behlendorf committed Oct 23, 2018
1 parent b53cb02 commit d02a709da1bc35a0c118e308a1c4a688b21b632b
Showing with 35 additions and 12 deletions.
  1. +16 −4 man/man5/zfs-module-parameters.5
  2. +10 −0 module/zfs/vdev_disk.c
  3. +9 −8 module/zfs/zil.c
@@ -1846,8 +1846,9 @@ Use \fB1\fR for yes and \fB0\fR for no (default).
\fBzfs_nocacheflush\fR (int)
.ad
.RS 12n
Disable cache flush operations on disks when writing. Beware, this may cause
corruption if disks re-order writes.
Disable cache flush operations on disks when writing. Setting this will
cause pool corruption on power loss if a volatile out-of-order write cache
is enabled.
.sp
Use \fB1\fR for yes and \fB0\fR for no (default).
.RE
@@ -1903,8 +1904,6 @@ A value of zero will disable this throttle.
Default value: \fB30\fR and \fB0\fR to disable.
.RE
.sp
.ne 2
.na
@@ -2527,6 +2526,19 @@ value of 100% will create a maximum of one thread per cpu.
Default value: \fB100\fR%.
.RE
.sp
.ne 2
.na
\fBzil_nocacheflush\fR (int)
.ad
.RS 12n
Disable the cache flush commands that are normally sent to the disk(s) by
the ZIL after an LWB write has completed. Setting this will cause ZIL
corruption on power loss if a volatile out-of-order write cache is enabled.
.sp
Use \fB1\fR for yes and \fB0\fR for no (default).
.RE
.sp
.ne 2
.na
@@ -39,6 +39,13 @@
char *zfs_vdev_scheduler = VDEV_SCHEDULER;
static void *zfs_vdev_holder = VDEV_HOLDER;
/*
* Tunable parameter for debugging or performance analysis. Setting this
* will cause pool corruption on power loss if a volatile out-of-order
* write cache is enabled.
*/
int zfs_nocacheflush = 0;
/* size of the "reserved" partition, in blocks */
#define EFI_MIN_RESV_SIZE (16 * 1024)
@@ -897,3 +904,6 @@ vdev_ops_t vdev_disk_ops = {
module_param_call(zfs_vdev_scheduler, param_set_vdev_scheduler,
param_get_charp, &zfs_vdev_scheduler, 0644);
MODULE_PARM_DESC(zfs_vdev_scheduler, "I/O scheduler");
module_param(zfs_nocacheflush, int, 0644);
MODULE_PARM_DESC(zfs_nocacheflush, "Disable cache flushes");
@@ -118,11 +118,12 @@ static kstat_t *zil_ksp;
int zil_replay_disable = 0;
/*
* Tunable parameter for debugging or performance analysis. Setting
* zfs_nocacheflush will cause corruption on power loss if a volatile
* out-of-order write cache is enabled.
* Disable the DKIOCFLUSHWRITECACHE commands that are normally sent to
* the disk(s) by the ZIL after an LWB write has completed. Setting this
* will cause ZIL corruption on power loss if a volatile out-of-order
* write cache is enabled.
*/
int zfs_nocacheflush = 0;
int zil_nocacheflush = 0;
/*
* Limit SLOG write size per commit executed with synchronous priority.
@@ -1041,7 +1042,7 @@ zil_lwb_add_block(lwb_t *lwb, const blkptr_t *bp)
int ndvas = BP_GET_NDVAS(bp);
int i;
if (zfs_nocacheflush)
if (zil_nocacheflush)
return;
mutex_enter(&lwb->lwb_vdev_lock);
@@ -1065,7 +1066,7 @@ zil_lwb_add_txg(lwb_t *lwb, uint64_t txg)
/*
* This function is a called after all VDEVs associated with a given lwb
* write have completed their DKIOCFLUSHWRITECACHE command; or as soon
* as the lwb write completes, if "zfs_nocacheflush" is set.
* as the lwb write completes, if "zil_nocacheflush" is set.
*
* The intention is for this function to be called as soon as the
* contents of an lwb are considered "stable" on disk, and will survive
@@ -3513,8 +3514,8 @@ MODULE_PARM_DESC(zfs_commit_timeout_pct, "ZIL block open timeout percentage");
module_param(zil_replay_disable, int, 0644);
MODULE_PARM_DESC(zil_replay_disable, "Disable intent logging replay");
module_param(zfs_nocacheflush, int, 0644);
MODULE_PARM_DESC(zfs_nocacheflush, "Disable cache flushes");
module_param(zil_nocacheflush, int, 0644);
MODULE_PARM_DESC(zil_nocacheflush, "Disable ZIL cache flushes");
module_param(zil_slog_bulk, ulong, 0644);
MODULE_PARM_DESC(zil_slog_bulk, "Limit in bytes slog sync writes per commit");

0 comments on commit d02a709

Please sign in to comment.