zfsonlinux/zfs — pull request #1023 by maxximino (2012-10-07 20:05:00+00:00)
Title: Switch KM_SLEEP to KM_PUSHPAGE

I think I've found another point in which KM_SLEEP needs to be changed to KM_PUSHPAGE.

ZFS at commit: 7bd04f2d7d99780f190d4027e6e81fc0df11ba95
SPL at commit: bbdc6ae49518a4be7230ab673370e9231e2f72e7
Built into kernel 3.5.5+grsecurity.

kernel log:
[79553.413194] SPL: Fixing allocation for task txg_sync (2251) which used GFP flags 0xf6ce5b9c with PF_NOFS set
[79553.413196] SPL: Showing stack for process 2251
[79553.413198] Pid: 2251, comm: txg_sync Not tainted 3.5.5-grsec+ #1
[79553.413199] Call Trace:
[79553.413204] [] spl_debug_dumpstack+0x2f/0x50
[79553.413207] [] sanitize_flags.part.13+0x6b/0x7a
[79553.413209] [] kmem_alloc_debug+0x38f/0x3c0
[79553.413212] [] snapshot_check+0xc6/0xf0
[79553.413215] [] dsl_sync_task_group_sync+0xfc/0x260
[79553.413217] [] dsl_pool_sync+0x1eb/0x470
[79553.413219] [] spa_sync+0x3d0/0x9d0
[79553.413223] [] ? __mutex_unlock_slowpath+0x1a/0x50
[79553.413225] [] txg_sync_thread+0x2c3/0x490
[79553.413226] [] ? txg_quiesce_thread+0x300/0x300
[79553.413228] [] thread_generic_wrapper+0x84/0xa0
[79553.413230] [] ? __thread_create+0x340/0x340
[79553.413232] [] kthread+0x9f/0xb0
[79553.413235] [] kernel_thread_helper+0x9/0x20
[79553.413237] [] ? retint_restore_args+0xb/0x12
[79553.413238] [] ? kthread_freezable_should_stop+0x70/0x70
[79553.413240] [] ? gs_change+0x13/0x13
[79559.970188] SPL: Fixing allocation for task txg_sync (2251) which used GFP flags 0xf6ce5b9c with PF_NOFS set
[79559.970191] SPL: Showing stack for process 2251
[79559.970192] Pid: 2251, comm: txg_sync Not tainted 3.5.5-grsec+ #1
[79559.970193] Call Trace:
[79559.970198] [] spl_debug_dumpstack+0x2f/0x50
[79559.970201] [] sanitize_flags.part.13+0x6b/0x7a
[79559.970203] [] kmem_alloc_debug+0x38f/0x3c0
[79559.970206] [] snapshot_check+0xc6/0xf0
[79559.970209] [] dsl_sync_task_group_sync+0xfc/0x260
[79559.970211] [] dsl_pool_sync+0x1eb/0x470
[79559.970213] [] spa_sync+0x3d0/0x9d0
[79559.970215] [] txg_sync_thread+0x2c3/0x490
[79559.970217] [] ? txg_quiesce_thread+0x300/0x300
[79559.970219] [] thread_generic_wrapper+0x84/0xa0
[79559.970221] [] ? __thread_create+0x340/0x340
[79559.970223] [] kthread+0x9f/0xb0
[79559.970226] [] kernel_thread_helper+0x9/0x20
[79559.970228] [] ? retint_restore_args+0xb/0x12
[79559.970230] [] ? kthread_freezable_should_stop+0x70/0x70
[79559.970231] [] ? gs_change+0x13/0x13

I've noticed those messages right after having deleted two snapshots and started a scrub.

I haven't rigorously tested this commit, but looking at the stack trace, looks like there is only a call to kmem_alloc which can cause this.