Skip to content

Commit

Permalink
Switch KM_SLEEP to KM_PUSHPAGE
Browse files Browse the repository at this point in the history
This warning indicates the incorrect use of KM_SLEEP in a call
path which must use KM_PUSHPAGE to avoid deadlocking in direct
reclaim.  See commit b8d06fc
for additional details.

  SPL: Fixing allocation for task txg_sync (6093) which
  used GFP flags 0x297bda7c with PF_NOFS set

Signed-off-by: Brian Behlendorf <[email protected]>
Issue #917
  • Loading branch information
behlendorf committed Sep 4, 2012
1 parent 395350c commit 0ef0ff5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/sys/zfs_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ typedef struct taskq_ent {

#define TQ_SLEEP KM_SLEEP /* Can block for memory */
#define TQ_NOSLEEP KM_NOSLEEP /* cannot block for memory; may fail */
#define TQ_PUSHPAGE KM_PUSHPAGE /* Cannot perform I/O */
#define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */
#define TQ_FRONT 0x08 /* Queue in front */

Expand Down
4 changes: 2 additions & 2 deletions module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ iput_async(struct inode *ip, taskq_t *taskq)
{
ASSERT(atomic_read(&ip->i_count) > 0);
if (atomic_read(&ip->i_count) == 1)
taskq_dispatch(taskq, (task_func_t *)iput, ip, TQ_SLEEP);
taskq_dispatch(taskq, (task_func_t *)iput, ip, TQ_PUSHPAGE);
else
iput(ip);
}
Expand Down Expand Up @@ -934,7 +934,7 @@ zfs_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
return (ENOENT);
}

zgd = (zgd_t *)kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
zgd = (zgd_t *)kmem_zalloc(sizeof (zgd_t), KM_PUSHPAGE);
zgd->zgd_zilog = zsb->z_log;
zgd->zgd_private = zp;

Expand Down

0 comments on commit 0ef0ff5

Please sign in to comment.