]> granicus.if.org Git - zfs/commitdiff
Switch KM_SLEEP to KM_PUSHPAGE
authorMassimo Maggi <massimo@mmmm.it>
Thu, 11 Oct 2012 23:19:48 +0000 (16:19 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 11 Oct 2012 23:22:29 +0000 (16:22 -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>
module/spl/spl-tsd.c

index b43da7746fb418ce47fb1ff785f1b7886321756d..f5c579578bba42a729b58e33bca9a75a203cecc7 100644 (file)
@@ -174,7 +174,7 @@ tsd_hash_add(tsd_hash_table_t *table, uint_t key, pid_t pid, void *value)
        ASSERT3P(tsd_hash_search(table, key, pid), ==, NULL);
 
        /* New entry allocate structure, set value, and add to hash */
-       entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_SLEEP);
+       entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE);
        if (entry == NULL)
                SRETURN(ENOMEM);
 
@@ -234,7 +234,7 @@ tsd_hash_add_key(tsd_hash_table_t *table, uint_t *keyp, dtor_func_t dtor)
        ASSERT3P(table, !=, NULL);
 
        /* Allocate entry to be used as a destructor for this key */
-       entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_SLEEP);
+       entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE);
        if (entry == NULL)
                SRETURN(ENOMEM);
 
@@ -293,7 +293,7 @@ tsd_hash_add_pid(tsd_hash_table_t *table, pid_t pid)
        SENTRY;
 
        /* Allocate entry to be used as the process reference */
-       entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_SLEEP);
+       entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE);
        if (entry == NULL)
                SRETURN(ENOMEM);