freebsd-src/cddl/contrib/opensolaris/cmd
Andriy Gapon c13f1d82c8 MFV r323535: 8585 improve batching done in zil_commit()
FreeBSD notes:
- this MFV reverts FreeBSD commit r314549 to make the merge easier
- at present our emulation of cv_timedwait_hires is rather poor,
  so I elected to use cv_timedwait_sbt directly
Please see the differential revision for details.
Unfortunately, I did not get any positive reviews, so there could be
bugs in the FreeBSD-specific piece of the merge.
Hence, the long MFC timeout.

illumos/illumos-gate@1271e4b10d
1271e4b10d

https://www.illumos.org/issues/8585
  The current implementation of zil_commit() can introduce significant
  latency, beyond what is inherent due to the latency of the underlying
  storage. The additional latency comes from two main problems:
  1. When there's outstanding ZIL blocks being written (i.e. there's
      already a "writer thread" in progress), then any new calls to
      zil_commit() will block waiting for the currently oustanding ZIL
      blocks to complete. The blocks written for each "writer thread" is
      coined a "batch", and there can only ever be a single "batch" being
      written at a time. When a batch is being written, any new ZIL
      transactions will have to wait for the next batch to be written,
      which won't occur until the current batch finishes.
  As a result, the underlying storage may not be used as efficiently
      as possible. While "new" threads enter zil_commit() and are blocked
      waiting for the next batch, it's possible that the underlying
      storage isn't fully utilized by the current batch of ZIL blocks. In
      that case, it'd be better to allow these new threads to generate
      (and issue) a new ZIL block, such that it could be serviced by the
      underlying storage concurrently with the other ZIL blocks that are
      being serviced.
  2. Any call to zil_commit() must wait for all ZIL blocks in its "batch"
      to complete, prior to zil_commit() returning. The size of any given
      batch is proportional to the number of ZIL transaction in the queue
      at the time that the batch starts processing the queue; which
      doesn't occur until the previous batch completes. Thus, if there's a
      lot of transactions in the queue, the batch could be composed of
      many ZIL blocks, and each call to zil_commit() will have to wait for
      all of these writes to complete (even if the thread calling
      zil_commit() only cared about one of the transactions in the batch).

Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D12355
2017-09-26 11:04:08 +00:00
..
dtrace Fix the raise tests. 2017-09-15 19:48:48 +00:00
lockstat Rework and simplify the ksyms(4) implementation. 2017-08-03 00:38:13 +00:00
mdb/tools/common Mechanically convert cddl sun #ifdef's to illumos 2015-01-17 14:44:59 +00:00
plockstat Fix the build for non-amd64. 2015-12-02 02:11:38 +00:00
pyzfs Merge ZFS version 15 and almost all OpenSolaris bugfixes referenced 2010-07-12 23:49:04 +00:00
stat/common Finally... Import the latest open-source ZFS version - (SPA) 28. 2011-02-27 19:41:40 +00:00
zdb MFV r318946: 8021 ARC buf data scatter-ization 2017-06-20 17:39:24 +00:00
zfs MFV 316894 2017-04-25 17:57:43 +00:00
zhack MFV r302660: 6314 buffer overflow in dsl_dataset_name 2016-09-01 15:08:27 +00:00
zinject MFV r296505: 6531 Provide mechanism to artificially limit disk performance 2016-03-08 17:27:13 +00:00
zlook Finally... Import the latest open-source ZFS version - (SPA) 28. 2011-02-27 19:41:40 +00:00
zpool MFV r323790: 8567 Inconsistent return value in zpool_read_label 2017-09-20 07:23:50 +00:00
zstreamdump MFV 316894 2017-04-25 17:57:43 +00:00
ztest MFV r323535: 8585 improve batching done in zil_commit() 2017-09-26 11:04:08 +00:00