Date: Thu, 16 Mar 2017 07:11:35 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r315388 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201703160711.v2G7BZRK099293@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Mar 16 07:11:35 2017 New Revision: 315388 URL: https://svnweb.freebsd.org/changeset/base/315388 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/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Mar 16 07:11:05 2017 (r315387) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Mar 16 07:11:35 2017 (r315388) @@ -956,7 +956,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; @@ -1057,6 +1057,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 */ /* @@ -1093,7 +1095,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); @@ -1554,7 +1556,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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703160711.v2G7BZRK099293>