summaryrefslogtreecommitdiffstats
path: root/module/zfs/zil.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-04-26 12:56:35 -0700
committerBrian Behlendorf <[email protected]>2011-04-26 12:56:35 -0700
commit701b1f8168ebb0ad6b6958b9593488c17adebb44 (patch)
treee042be24001649626dface6334c778a138a75b4a /module/zfs/zil.c
parenta1cc0b3290dcf1b5cf759c89352d8bdb44ee41e6 (diff)
Fix zvol deadlock
It's possible for a zvol_write thread to enter direct memory reclaim while holding open a transaction group. This results in the system attempting to write out data to the disk to free memory. Unfortunately, this can't succeed because the the thread doing reclaim is holding open the txg which must be closed to be synced to disk. To prevent this the offending allocation is marked KM_PUSHPAGE which will prevent it from attempting writeback. Closes #191
Diffstat (limited to 'module/zfs/zil.c')
-rw-r--r--module/zfs/zil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/zil.c b/module/zfs/zil.c
index ad11fd6c6..79f519f83 100644
--- a/module/zfs/zil.c
+++ b/module/zfs/zil.c
@@ -1075,7 +1075,8 @@ zil_itx_create(uint64_t txtype, size_t lrsize)
lrsize = P2ROUNDUP_TYPED(lrsize, sizeof (uint64_t), size_t);
- itx = kmem_alloc(offsetof(itx_t, itx_lr) + lrsize, KM_SLEEP|KM_NODEBUG);
+ itx = kmem_alloc(offsetof(itx_t, itx_lr) + lrsize,
+ KM_PUSHPAGE | KM_NODEBUG);
itx->itx_lr.lrc_txtype = txtype;
itx->itx_lr.lrc_reclen = lrsize;
itx->itx_sod = lrsize; /* if write & WR_NEED_COPY will be increased */