Skip to content

Commit

Permalink
Switch KM_SLEEP to KM_PUSHPAGE
Browse files Browse the repository at this point in the history
trim_map_segment_add() can now be called from the ARC when buffers are
released from the L2ARC, so protect against direct reclaim.

This fixes the following issue:

	SPLError: 22911:0:(kmem.h:90:sanitize_flags()) FATAL allocation for task txg_sync (22911) which used GFP flags 0x5345943c with PF_NOFS set
	SPLError: 22911:0:(kmem.h:90:sanitize_flags()) SPL PANIC
	SPL: Showing stack for process 22911
	Pid: 22911, comm: txg_sync Tainted: P           O 3.2.28-zfsdev-std-ipv6-64 #6
	Call Trace:
	 [<ffffffffa0294df7>] spl_debug_dumpstack+0x27/0x40 [spl]
	 [<ffffffffa02962cc>] spl_debug_bug+0x7c/0xe0 [spl]
	 [<ffffffffa029dabb>] kmem_alloc_debug+0x51b/0x530 [spl]
	 [<ffffffffa040dfb1>] trim_map_segment_add+0x211/0x350 [zfs]
	 [<ffffffffa040e1e9>] trim_map_free_locked+0xf9/0x150 [zfs]
	 [<ffffffffa040e2dd>] trim_map_free+0x9d/0x130 [zfs]
	 [<ffffffffa0380f9f>] arc_release+0x3cf/0x940 [zfs]
	 [<ffffffffa03917f8>] dbuf_dirty+0xdc8/0x1980 [zfs]
	 [<ffffffffa0393192>] dmu_buf_will_dirty+0x102/0x1c0 [zfs]
	 [<ffffffffa039c938>] dmu_write+0x98/0x260 [zfs]
	 [<ffffffffa0405295>] spa_history_write+0x175/0x200 [zfs]
	 [<ffffffffa0405d53>] spa_history_log_sync+0x313/0x960 [zfs]
	 [<ffffffffa03e3c29>] dsl_sync_task_group_sync+0x139/0x380 [zfs]
	 [<ffffffffa03d94fd>] dsl_pool_sync+0x2ed/0x860 [zfs]
	 [<ffffffffa03f50f7>] spa_sync+0x3b7/0xc50 [zfs]
	 [<ffffffffa04103fb>] txg_sync_thread+0x2cb/0x560 [zfs]
	 [<ffffffffa029f051>] thread_generic_wrapper+0x81/0xe0 [spl]
	 [<ffffffff810c1e56>] kthread+0x96/0xa0
	 [<ffffffff81c20d74>] kernel_thread_helper+0x4/0x10
  • Loading branch information
dechamps committed Sep 25, 2012
1 parent deda532 commit 94d6d97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/trim_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ trim_map_segment_add(trim_map_t *tm, uint64_t start, uint64_t end, uint64_t txg)
} else if (merge_after) {
ts_after->ts_start = start;
} else {
ts = kmem_alloc(sizeof (*ts), KM_SLEEP);
ts = kmem_alloc(sizeof (*ts), KM_PUSHPAGE);
ts->ts_start = start;
ts->ts_end = end;
ts->ts_txg = txg;
Expand Down

0 comments on commit 94d6d97

Please sign in to comment.