freebsd-nq/sys
Allan Jude c79b58ccc5 Pull in a follow-on commit to resolve a deadlock in ZFS sequential
resilver (r334844)

MFV/ZoL: Fix deadlock in IO pipeline

commit a76f3d0437
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   Fri Mar 16 16:46:06 2018 -0700

    Fix deadlock in IO pipeline

    In vdev_queue_aggregate() the zio_execute() bypass should not be
    called under the vdev queue lock.  This can result in a deadlock
    as shown in the stack traces below.

    Drop the vdev queue lock then walk the parents of the aggregate IO
    to determine the list of component IOs to be bypassed.  This can
    be done safely without holding the io_lock since the new aggregate
    IO has not yet been returned and its parents cannot change.

    ---  THREAD 1 ---
    arc_read()
      zio_nowait()
        zio_vdev_io_start()
          vdev_queue_io() <--- mutex_enter(vq->vq_lock)
            vdev_queue_io_to_issue()
              vdev_queue_aggregate()
                zio_execute()
            vdev_queue_io_to_issue()
              vdev_queue_aggregate()
                zio_execute()
                  zio_vdev_io_assess()
                    zio_wait_for_children() <- mutex_enter(zio->io_lock)

    --- THREAD 2 --- (inverse order)
    arc_read()
      zio_change_priority() <- mutex_enter(zio->zio_lock)
        vdev_queue_change_io_priority() <- mutex_enter(vq->vq_lock)

    Reviewed-by: Tom Caputi <tcaputi@datto.com>
    Reviewed-by: Don Brady <don.brady@delphix.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

Reported by:	ZFS Leadership Meeting
Reviewed by:	mav
Approved by:	re (kib)
Obtained from:	ZFS-on-Linux
MFC after:	2 weeks
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D17495
2018-10-10 22:59:15 +00:00
..
amd64 Regenerated assorted syscall related files after: 2018-10-09 20:42:17 +00:00
arm Enable Capsicum on armv6/armv7 2018-09-13 21:00:17 +00:00
arm64 Address the warning regarding duplicate option 'GEOM_PART_GPT' when 2018-10-07 15:54:13 +00:00
bsm
cam Move 32-bit compat support for CDIOREADTOCENTRYS to the right place. 2018-10-02 23:23:56 +00:00
cddl Pull in a follow-on commit to resolve a deadlock in ZFS sequential 2018-10-10 22:59:15 +00:00
compat Regenerated assorted syscall related files after: 2018-10-09 20:42:17 +00:00
conf Update head from ALPHA8 to ALPHA9 as part of the 12.0-RELEASE 2018-10-09 21:54:58 +00:00
contrib Update ACPICA to 20181003. 2018-10-09 18:40:36 +00:00
crypto Reapply, with minor tweaks, r338025, from the original commit: 2018-09-26 17:12:14 +00:00
ddb
dev Update Armada 38x UART device tree binding 2018-10-10 10:34:17 +00:00
dts arm64: Add DTS overlays for A64 2018-08-24 15:00:36 +00:00
fs MFH r338661 through r339253. 2018-10-09 14:27:55 +00:00
gdb
geom MFH r338661 through r339200. 2018-10-05 17:53:47 +00:00
gnu dts: Import DTS for arm64 2018-08-23 13:21:01 +00:00
i386 Regenerated assorted syscall related files after: 2018-10-09 20:42:17 +00:00
isa Reapply, with minor tweaks, r338025, from the original commit: 2018-09-26 17:12:14 +00:00
kern Fix the test prohibiting jails from sharing IP addresses. 2018-10-06 02:10:32 +00:00
kgssapi
libkern
mips Re-enable kernel modules for the MALTA64EL kernel configuration. 2018-09-06 19:21:31 +00:00
modules Catch exceptions during EFI RT calls on amd64. 2018-09-02 21:37:05 +00:00
net MFH r338661 through r339253. 2018-10-09 14:27:55 +00:00
net80211
netgraph Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
netinet MFH r338661 through r339253. 2018-10-09 14:27:55 +00:00
netinet6 MFH r338661 through r339253. 2018-10-09 14:27:55 +00:00
netipsec Fix witness warning in xform_init(). 2018-09-26 14:47:51 +00:00
netpfil Significantly improve pf purge cpu usage by only taking locks 2018-09-16 00:44:23 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Introduce and use sgid_index in CM requests in ibcore. 2018-09-09 07:20:15 +00:00
opencrypto Add per-session locking to cryptosoft (swcr). 2018-09-26 20:23:12 +00:00
powerpc Enable TCP Fast Open support for PPC platforms. 2018-10-07 12:56:05 +00:00
riscv Implement pmap_sync_icache(). 2018-09-24 17:41:29 +00:00
rpc
security Rework the logic around quick checks for auditing that take place at 2018-10-02 15:58:17 +00:00
sparc64 Prepare the kernel linker to handle PC-relative ifunc relocations. 2018-08-22 20:44:30 +00:00
sys Merge the remainder of the projects/openssl111 branch to head. 2018-10-09 21:28:26 +00:00
teken
tests
tools make_dtb: Always add root directory in the include path 2018-08-23 13:23:21 +00:00
ufs Correct panic messages. 2018-09-22 17:05:49 +00:00
vm eliminate locking surrounding ui_vmsize and swap reserve by using atomics 2018-10-05 05:50:56 +00:00
x86 Fix an inverted test in ucode_load_ap(). 2018-10-03 14:20:43 +00:00
xdr
xen xen: legacy PVH fixes for the new interrupt count 2018-09-13 07:14:11 +00:00
Makefile