svn commit: r315387 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Alexander Motin mav at FreeBSD.org
Thu Mar 16 07:11:06 UTC 2017


Author: mav
Date: Thu Mar 16 07:11:05 2017
New Revision: 315387
URL: https://svnweb.freebsd.org/changeset/base/315387

Log:
  MFC r314549: Execute last ZIO of log commit synchronously.
  
  For short transactions overhead of context switch can be too large.
  Skipping it gives significant latency reduction.  For large ones,
  including multiple ZIOs, latency is less critical, while throughput
  there may become limited by checksumming speed of single CPU core.
  To get best of both cases, execute last ZIO directly from calling
  thread context to save latency, while all others (if there are any)
  enqueue to taskqueues in traditional way.

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Thu Mar 16 07:10:08 2017	(r315386)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Thu Mar 16 07:11:05 2017	(r315387)
@@ -953,7 +953,7 @@ uint64_t zil_slog_limit = 1024 * 1024;
  * Calls are serialized.
  */
 static lwb_t *
-zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb)
+zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb, boolean_t last)
 {
 	lwb_t *nlwb = NULL;
 	zil_chain_t *zilc;
@@ -1054,6 +1054,8 @@ zil_lwb_write_start(zilog_t *zilog, lwb_
 	 */
 	bzero(lwb->lwb_buf + lwb->lwb_nused, wsz - lwb->lwb_nused);
 
+	if (last)
+		lwb->lwb_zio->io_pipeline &= ~ZIO_STAGE_ISSUE_ASYNC;
 	zio_nowait(lwb->lwb_zio); /* Kick off the write for the old log block */
 
 	/*
@@ -1090,7 +1092,7 @@ zil_lwb_commit(zilog_t *zilog, itx_t *it
 	 * If this record won't fit in the current log block, start a new one.
 	 */
 	if (lwb->lwb_nused + reclen + dlen > lwb->lwb_sz) {
-		lwb = zil_lwb_write_start(zilog, lwb);
+		lwb = zil_lwb_write_start(zilog, lwb, B_FALSE);
 		if (lwb == NULL)
 			return (NULL);
 		zil_lwb_write_init(zilog, lwb);
@@ -1551,7 +1553,7 @@ zil_commit_writer(zilog_t *zilog)
 
 	/* write the last block out */
 	if (lwb != NULL && lwb->lwb_zio != NULL)
-		lwb = zil_lwb_write_start(zilog, lwb);
+		lwb = zil_lwb_write_start(zilog, lwb, B_TRUE);
 
 	zilog->zl_cur_used = 0;
 


More information about the svn-src-all mailing list