svn commit: r318947 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest

Andriy Gapon avg at FreeBSD.org
Fri May 26 12:14:00 UTC 2017


Author: avg
Date: Fri May 26 12:13:58 2017
New Revision: 318947
URL: https://svnweb.freebsd.org/changeset/base/318947

Log:
  7578 Fix/improve some aspects of ZIL writing.
  
  illumos/illumos-gate at c5ee46810f82e8a53d2cc5a487568a573f449039
  https://github.com/illumos/illumos-gate/commit/c5ee46810f82e8a53d2cc5a487568a573f449039
  
  https://www.illumos.org/issues/7578
    After some ZIL changes 6 years ago zil_slog_limit got partially broken
    due to zl_itx_list_sz not updated when async itx'es upgraded to sync.
    Actually because of other changes about that time zl_itx_list_sz is not
    really required to implement the functionality, so this patch removes
    some unneeded broken code and variables.
    Original idea of zil_slog_limit was to reduce chance of SLOG abuse by
    single heavy logger, that increased latency for other (more latency critical)
    loggers, by pushing heavy log out into the main pool instead of SLOG. Beside
    huge latency increase for heavy writers, this implementation caused double
    write of all data, since the log records were explicitly prepared for SLOG.
    Since we now have I/O scheduler, I've found it can be much more efficient
    to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE
    to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG.
    Existing ZIL implementation had problem with space efficiency when it
    has to write large chunks of data into log blocks of limited size. In some
    cases efficiency stopped to almost as low as 50%. In case of ZIL stored on
    spinning rust, that also reduced log write speed in half, since head had to
    uselessly fly over allocated but not written areas. This change improves
    the situation by offloading problematic operations from z*_log_write() to
    zil_lwb_commit(), which knows real situation of log blocks allocation and
    can split large requests into pieces much more efficiently. Also as side
    effect it removes one of two data copy operations done by ZIL code WR_COPIED
    case.
    While there, untangle and unify code of z*_log_write() functions.
    Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing
    block boundary, that may also improve efficiency if ZPL is made to do that.
  
  Reviewed by: Matthew Ahrens <mahrens at delphix.com>
  Reviewed by: Prakash Surya <prakash.surya at delphix.com>
  Reviewed by: Andriy Gapon <avg at FreeBSD.org>
  Reviewed by: Steven Hartland <steven.hartland at multiplay.co.uk>
  Reviewed by: Brad Lewis <brad.lewis at delphix.com>
  Reviewed by: Richard Elling <Richard.Elling at RichardElling.com>
  Approved by: Robert Mustacchi <rm at joyent.com>
  Author: Alexander Motin <mav at FreeBSD.org>

Modified:
  vendor/illumos/dist/cmd/ztest/ztest.c

Changes in other areas also in this revision:
Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_log.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c

Modified: vendor/illumos/dist/cmd/ztest/ztest.c
==============================================================================
--- vendor/illumos/dist/cmd/ztest/ztest.c	Fri May 26 12:13:27 2017	(r318946)
+++ vendor/illumos/dist/cmd/ztest/ztest.c	Fri May 26 12:13:58 2017	(r318947)
@@ -1377,7 +1377,6 @@ ztest_log_write(ztest_ds_t *zd, dmu_tx_t
 	itx->itx_private = zd;
 	itx->itx_wr_state = write_state;
 	itx->itx_sync = (ztest_random(8) == 0);
-	itx->itx_sod += (write_state == WR_NEED_COPY ? lr->lr_length : 0);
 
 	bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
 	    sizeof (*lr) - sizeof (lr_t));


More information about the svn-src-all mailing list