Switch KM_SLEEP to KM_PUSHPAGE
authorMassimo Maggi <massimo@mmmm.it>
Thu, 11 Oct 2012 22:55:42 +0000 (00:55 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 15 Oct 2012 16:32:38 +0000 (09:32 -0700)
In this particular instance the allocation occurred in the context
of sys_msync()->...->zpl_putpage() where we must be careful not to
initiate additional I/O.

Signed-off-by: Massimo Maggi <massimo@mmmm.it>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1038

module/zfs/zfs_rlock.c

index 4f34b37..208de10 100644 (file)
@@ -199,7 +199,7 @@ zfs_range_proxify(avl_tree_t *tree, rl_t *rl)
        rl->r_cnt = 0;
 
        /* create a proxy range lock */
-       proxy = kmem_alloc(sizeof (rl_t), KM_SLEEP);
+       proxy = kmem_alloc(sizeof (rl_t), KM_PUSHPAGE);
        proxy->r_off = rl->r_off;
        proxy->r_len = rl->r_len;
        proxy->r_cnt = 1;
@@ -228,7 +228,7 @@ zfs_range_split(avl_tree_t *tree, rl_t *rl, uint64_t off)
        ASSERT(rl->r_read_wanted == B_FALSE);
 
        /* create the rear proxy range lock */
-       rear = kmem_alloc(sizeof (rl_t), KM_SLEEP);
+       rear = kmem_alloc(sizeof (rl_t), KM_PUSHPAGE);
        rear->r_off = off;
        rear->r_len = rl->r_off + rl->r_len - off;
        rear->r_cnt = rl->r_cnt;