Files
mirror_zfs/module/zfs
jdike 48be0dfba1 lockdep false positive - move txg_kick() outside of ->dp_lock
This fixes a lockdep warning by breaking a link between ->tx_sync_lock
and ->dp_lock.

The deadlock envisioned by lockdep is this:
    thread 1 holds db->db_mtx and tries to get dp->dp_lock:
	dsl_pool_dirty_space+0x70/0x2d0 [zfs]
	dbuf_dirty+0x778/0x31d0 [zfs]

    thread 2 holds bpo->bpo_lock and tries to get db->db_mtx:
        dmu_buf_will_dirty_impl
        dmu_buf_will_dirty+0x6b/0x6c0 [zfs]
        bpobj_iterate_impl+0xbe6/0x1410 [zfs]

    thread 3 holds tx->tx_sync_lock and tries to get bpo->bpo_lock:
        bpobj_space+0x63/0x470 [zfs]
        dsl_scan_active+0x340/0x3d0 [zfs]
        txg_sync_thread+0x3f2/0x1370 [zfs]

    thread 4 holds dp->dp_lock and tries to get tx->tx_sync_lock
       txg_kick+0x61/0x420 [zfs]
       dsl_pool_need_dirty_delay+0x1c7/0x3f0 [zfs]

This patch is orginally from Brian Behlendorf and slightly simplified
by me.

It breaks this cycle in thread 4 by moving the call from
dsl_pool_need_dirty_delay to txg_kick outside the section controlled
by dp->dp_lock.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Jeff Dike <jdike@akamai.com>
Closes #9094
2019-07-31 14:53:39 -07:00
..
2019-07-26 10:54:14 -07:00
2019-07-26 10:54:14 -07:00
2019-06-19 09:48:12 -07:00
2019-06-19 09:48:12 -07:00
2019-07-26 10:54:14 -07:00
2019-06-19 14:54:02 -07:00
2019-06-19 09:48:12 -07:00
2019-05-07 15:18:44 -07:00
2019-07-16 10:11:49 -07:00
2019-06-19 09:48:12 -07:00
2019-06-19 09:48:12 -07:00
2019-06-19 09:48:12 -07:00
2019-07-25 11:57:58 -07:00
2019-07-08 13:18:50 -07:00
2019-07-25 11:57:58 -07:00
2019-06-19 09:48:12 -07:00
2019-07-26 10:54:14 -07:00
2019-07-26 10:54:14 -07:00
2018-05-29 16:00:33 -07:00
2019-07-26 10:54:14 -07:00
2019-07-26 10:54:14 -07:00
2018-05-29 16:00:33 -07:00
2019-07-26 10:54:14 -07:00
2018-05-29 16:00:33 -07:00
2017-10-11 16:54:48 -04:00
2019-05-02 16:46:04 -07:00
2015-01-16 14:41:26 -08:00
2019-07-16 10:11:49 -07:00
2019-06-19 09:48:12 -07:00
2019-07-16 10:11:49 -07:00
2019-06-19 09:48:12 -07:00
2018-03-15 10:53:58 -07:00
2010-08-31 13:41:58 -07:00
2018-05-29 16:00:33 -07:00
2019-07-26 10:54:14 -07:00
2019-07-16 10:11:49 -07:00
2019-07-26 10:54:14 -07:00
2019-07-16 10:11:49 -07:00
2019-07-16 10:11:49 -07:00
2018-05-29 16:00:33 -07:00
2019-06-20 18:29:02 -07:00
2019-07-16 10:11:49 -07:00
2019-03-29 09:13:20 -07:00
2019-06-20 18:29:02 -07:00
2019-06-20 18:29:02 -07:00
2016-11-29 14:34:33 -08:00
2019-06-20 18:29:02 -07:00
2019-07-16 10:11:49 -07:00
2019-06-20 18:29:02 -07:00
2019-03-29 09:13:20 -07:00
2019-07-16 10:11:49 -07:00
2019-06-12 13:13:09 -07:00
2019-07-16 14:14:12 -07:00
2018-05-29 16:00:33 -07:00
2018-05-29 16:00:33 -07:00
2019-06-10 11:48:42 -07:00
2018-05-29 16:00:33 -07:00
2018-02-13 14:54:54 -08:00
2019-06-19 09:48:12 -07:00
2019-06-10 11:48:42 -07:00
2019-03-15 14:14:31 -07:00
2019-07-16 10:11:49 -07:00
2018-02-09 10:08:05 -08:00
2018-05-29 16:00:33 -07:00
2019-07-26 10:54:14 -07:00