3246 ZFS I/O deadman thread
authorGeorge.Wilson <george.wilson@delphix.com>
Mon, 29 Apr 2013 22:49:23 +0000 (15:49 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 2 May 2013 00:05:52 +0000 (17:05 -0700)
commitcc92e9d0c3e67a7e66c844466f85696a087bf60a
tree97f27cdfb4a662dee0de0d916e7c92cc0e03a605
parent57f5a2008e2e6acf58934cf43c5fdca0faffa73e
3246 ZFS I/O deadman thread

Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>

NOTES: This patch has been reworked from the original in the
following ways to accomidate Linux ZFS implementation

*) Usage of the cyclic interface was replaced by the delayed taskq
   interface.  This avoids the need to implement new compatibility
   code and allows us to rely on the existing taskq implementation.

*) An extern for zfs_txg_synctime_ms was added to sys/dsl_pool.h
   because declaring externs in source files as was done in the
   original patch is just plain wrong.

*) Instead of panicing the system when the deadman triggers a
   zevent describing the blocked vdev and the first pending I/O
   is posted.  If the panic behavior is desired Linux provides
   other generic methods to panic the system when threads are
   observed to hang.

*) For reference, to delay zios by 30 seconds for testing you can
   use zinject as follows: 'zinject -d <vdev> -D30 <pool>'

References:
  illumos/illumos-gate@283b84606b6fc326692c03273de1774e8c122f9a
  https://www.illumos.org/issues/3246

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1396
20 files changed:
cmd/zinject/translate.c
cmd/zinject/zinject.c
include/sys/dsl_pool.h
include/sys/fm/fs/zfs.h
include/sys/spa.h
include/sys/spa_impl.h
include/sys/vdev.h
include/sys/vdev_impl.h
include/sys/zfs_context.h
include/sys/zfs_ioctl.h
include/sys/zio.h
lib/libzpool/taskq.c
module/zfs/spa.c
module/zfs/spa_misc.c
module/zfs/vdev.c
module/zfs/vdev_disk.c
module/zfs/vdev_queue.c
module/zfs/zfs_fm.c
module/zfs/zio.c
module/zfs/zio_inject.c