Skip to content

Commit

Permalink
Change KM_PUSHPAGE -> KM_SLEEP
Browse files Browse the repository at this point in the history
By marking DMU transaction processing contexts with PF_FSTRANS
we can revert the KM_PUSHPAGE -> KM_SLEEP changes.  This brings
us back in line with upstream.  In some cases this means simply
swapping the flags back.  For others fnvlist_alloc() was replaced
by nvlist_alloc(..., KM_PUSHPAGE) and must be reverted back to
fnvlist_alloc() which assumes KM_SLEEP.

The one place KM_PUSHPAGE is kept is when allocating ARC buffers
which allows us to dip in to reserved memory.  This is again the
same as upstream.

Signed-off-by: Brian Behlendorf <[email protected]>
  • Loading branch information
behlendorf committed Jan 16, 2015
1 parent efcd79a commit 79c76d5
Show file tree
Hide file tree
Showing 65 changed files with 269 additions and 281 deletions.
12 changes: 6 additions & 6 deletions include/sys/dbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,13 @@ boolean_t dbuf_is_metadata(dmu_buf_impl_t *db);
} \
_NOTE(CONSTCOND) } while (0)

#define dprintf_dbuf_bp(db, bp, fmt, ...) do { \
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
char *__blkbuf = kmem_alloc(BP_SPRINTF_LEN, KM_PUSHPAGE); \
#define dprintf_dbuf_bp(db, bp, fmt, ...) do { \
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
char *__blkbuf = kmem_alloc(BP_SPRINTF_LEN, KM_SLEEP); \
snprintf_blkptr(__blkbuf, BP_SPRINTF_LEN, bp); \
dprintf_dbuf(db, fmt " %s\n", __VA_ARGS__, __blkbuf); \
kmem_free(__blkbuf, BP_SPRINTF_LEN); \
} \
dprintf_dbuf(db, fmt " %s\n", __VA_ARGS__, __blkbuf); \
kmem_free(__blkbuf, BP_SPRINTF_LEN); \
} \
_NOTE(CONSTCOND) } while (0)

#define DBUF_VERIFY(db) dbuf_verify(db)
Expand Down
2 changes: 1 addition & 1 deletion include/sys/dsl_dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ int dsl_dataset_rollback(const char *fsname, void *owner, nvlist_t *result);
#ifdef ZFS_DEBUG
#define dprintf_ds(ds, fmt, ...) do { \
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
char *__ds_name = kmem_alloc(MAXNAMELEN, KM_PUSHPAGE); \
char *__ds_name = kmem_alloc(MAXNAMELEN, KM_SLEEP); \
dsl_dataset_name(ds, __ds_name); \
dprintf("ds=%s " fmt, __ds_name, __VA_ARGS__); \
kmem_free(__ds_name, MAXNAMELEN); \
Expand Down
2 changes: 1 addition & 1 deletion include/sys/dsl_dir.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void dsl_dir_set_reservation_sync_impl(dsl_dir_t *dd, uint64_t value,
#define dprintf_dd(dd, fmt, ...) do { \
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
char *__ds_name = kmem_alloc(MAXNAMELEN + strlen(MOS_DIR_NAME) + 1, \
KM_PUSHPAGE); \
KM_SLEEP); \
dsl_dir_name(dd, __ds_name); \
dprintf("dd=%s " fmt, __ds_name, __VA_ARGS__); \
kmem_free(__ds_name, MAXNAMELEN + strlen(MOS_DIR_NAME) + 1); \
Expand Down
12 changes: 6 additions & 6 deletions include/sys/spa.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,12 +877,12 @@ extern void spa_configfile_set(spa_t *, nvlist_t *, boolean_t);
extern void spa_event_notify(spa_t *spa, vdev_t *vdev, const char *name);

#ifdef ZFS_DEBUG
#define dprintf_bp(bp, fmt, ...) do { \
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
char *__blkbuf = kmem_alloc(BP_SPRINTF_LEN, KM_PUSHPAGE); \
snprintf_blkptr(__blkbuf, BP_SPRINTF_LEN, (bp)); \
dprintf(fmt " %s\n", __VA_ARGS__, __blkbuf); \
kmem_free(__blkbuf, BP_SPRINTF_LEN); \
#define dprintf_bp(bp, fmt, ...) do { \
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
char *__blkbuf = kmem_alloc(BP_SPRINTF_LEN, KM_SLEEP); \
snprintf_blkptr(__blkbuf, BP_SPRINTF_LEN, (bp)); \
dprintf(fmt " %s\n", __VA_ARGS__, __blkbuf); \
kmem_free(__blkbuf, BP_SPRINTF_LEN); \
} \
_NOTE(CONSTCOND) } while (0)
#else
Expand Down
1 change: 0 additions & 1 deletion include/sys/zfs_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ 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
2 changes: 1 addition & 1 deletion module/zcommon/zprop_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ zprop_iter_common(zprop_func func, void *cb, boolean_t show_all,
size = num_props * sizeof (zprop_desc_t *);

#if defined(_KERNEL)
order = kmem_alloc(size, KM_PUSHPAGE);
order = kmem_alloc(size, KM_SLEEP);
#else
if ((order = malloc(size)) == NULL)
return (ZPROP_CONT);
Expand Down
16 changes: 8 additions & 8 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ arc_cksum_compute(arc_buf_t *buf, boolean_t force)
return;
}
buf->b_hdr->b_freeze_cksum = kmem_alloc(sizeof (zio_cksum_t),
KM_PUSHPAGE);
KM_SLEEP);
fletcher_2_native(buf->b_data, buf->b_hdr->b_size,
buf->b_hdr->b_freeze_cksum);
mutex_exit(&buf->b_hdr->b_freeze_lock);
Expand Down Expand Up @@ -1477,7 +1477,7 @@ arc_buf_data_free(arc_buf_t *buf, void (*free_func)(void *, size_t))

if (HDR_L2_WRITING(hdr)) {
l2arc_data_free_t *df;
df = kmem_alloc(sizeof (l2arc_data_free_t), KM_PUSHPAGE);
df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP);
df->l2df_data = buf->b_data;
df->l2df_size = hdr->b_size;
df->l2df_func = free_func;
Expand Down Expand Up @@ -3142,7 +3142,7 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
arc_callback_t *acb = NULL;

acb = kmem_zalloc(sizeof (arc_callback_t),
KM_PUSHPAGE);
KM_SLEEP);
acb->acb_done = done;
acb->acb_private = private;
if (pio != NULL)
Expand Down Expand Up @@ -3284,7 +3284,7 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,

ASSERT(!GHOST_STATE(hdr->b_state));

acb = kmem_zalloc(sizeof (arc_callback_t), KM_PUSHPAGE);
acb = kmem_zalloc(sizeof (arc_callback_t), KM_SLEEP);
acb->acb_done = done;
acb->acb_private = private;

Expand Down Expand Up @@ -3341,7 +3341,7 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
atomic_inc_32(&hdr->b_l2hdr->b_hits);

cb = kmem_zalloc(sizeof (l2arc_read_callback_t),
KM_PUSHPAGE);
KM_SLEEP);
cb->l2rcb_buf = buf;
cb->l2rcb_spa = spa;
cb->l2rcb_bp = *bp;
Expand Down Expand Up @@ -3871,7 +3871,7 @@ arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
hdr->b_flags |= ARC_L2CACHE;
if (l2arc_compress)
hdr->b_flags |= ARC_L2COMPRESS;
callback = kmem_zalloc(sizeof (arc_write_callback_t), KM_PUSHPAGE);
callback = kmem_zalloc(sizeof (arc_write_callback_t), KM_SLEEP);
callback->awcb_ready = ready;
callback->awcb_physdone = physdone;
callback->awcb_done = done;
Expand Down Expand Up @@ -4979,7 +4979,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz,
list_insert_head(dev->l2ad_buflist, head);

cb = kmem_alloc(sizeof (l2arc_write_callback_t),
KM_PUSHPAGE);
KM_SLEEP);
cb->l2wcb_dev = dev;
cb->l2wcb_head = head;
pio = zio_root(spa, l2arc_write_done, cb,
Expand All @@ -4989,7 +4989,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz,
/*
* Create and add a new L2ARC header.
*/
l2hdr = kmem_cache_alloc(l2arc_hdr_cache, KM_PUSHPAGE);
l2hdr = kmem_cache_alloc(l2arc_hdr_cache, KM_SLEEP);
l2hdr->b_dev = dev;
l2hdr->b_daddr = 0;
arc_space_consume(L2HDR_SIZE, ARC_SPACE_L2HDRS);
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/bplist.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bplist_destroy(bplist_t *bpl)
void
bplist_append(bplist_t *bpl, const blkptr_t *bp)
{
bplist_entry_t *bpe = kmem_alloc(sizeof (*bpe), KM_PUSHPAGE);
bplist_entry_t *bpe = kmem_alloc(sizeof (*bpe), KM_SLEEP);

mutex_enter(&bpl->bpl_lock);
bpe->bpe_blk = *bp;
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/bptree.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ bptree_add(objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg,
VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db));
bt = db->db_data;

bte = kmem_zalloc(sizeof (*bte), KM_PUSHPAGE);
bte = kmem_zalloc(sizeof (*bte), KM_SLEEP);
bte->be_birth_txg = birth_txg;
bte->be_bp = *bp;
dmu_write(os, obj, bt->bt_end * sizeof (*bte), sizeof (*bte), bte, tx);
Expand Down
10 changes: 5 additions & 5 deletions module/zfs/dbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ dbuf_init(void)
* Large allocations which do not require contiguous pages
* should be using vmem_alloc() in the linux kernel
*/
h->hash_table = vmem_zalloc(hsize * sizeof (void *), KM_PUSHPAGE);
h->hash_table = vmem_zalloc(hsize * sizeof (void *), KM_SLEEP);
#else
h->hash_table = kmem_zalloc(hsize * sizeof (void *), KM_NOSLEEP);
#endif
Expand Down Expand Up @@ -1121,7 +1121,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
dn->dn_dirtyctx =
(dmu_tx_is_syncing(tx) ? DN_DIRTY_SYNC : DN_DIRTY_OPEN);
ASSERT(dn->dn_dirtyctx_firstset == NULL);
dn->dn_dirtyctx_firstset = kmem_alloc(1, KM_PUSHPAGE);
dn->dn_dirtyctx_firstset = kmem_alloc(1, KM_SLEEP);
}
mutex_exit(&dn->dn_mtx);

Expand Down Expand Up @@ -1198,7 +1198,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
* to make a copy of it so that the changes we make in this
* transaction group won't leak out when we sync the older txg.
*/
dr = kmem_zalloc(sizeof (dbuf_dirty_record_t), KM_PUSHPAGE);
dr = kmem_zalloc(sizeof (dbuf_dirty_record_t), KM_SLEEP);
list_link_init(&dr->dr_dirty_node);
if (db->db_level == 0) {
void *data_old = db->db_buf;
Expand Down Expand Up @@ -1764,7 +1764,7 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid,
ASSERT(RW_LOCK_HELD(&dn->dn_struct_rwlock));
ASSERT(dn->dn_type != DMU_OT_NONE);

db = kmem_cache_alloc(dbuf_cache, KM_PUSHPAGE);
db = kmem_cache_alloc(dbuf_cache, KM_SLEEP);

db->db_objset = os;
db->db.db_object = dn->dn_object;
Expand Down Expand Up @@ -2059,7 +2059,7 @@ dbuf_hold_impl(dnode_t *dn, uint8_t level, uint64_t blkid, int fail_sparse,
int error;

dh = kmem_zalloc(sizeof (struct dbuf_hold_impl_data) *
DBUF_HOLD_IMPL_MAX_DEPTH, KM_PUSHPAGE);
DBUF_HOLD_IMPL_MAX_DEPTH, KM_SLEEP);
__dbuf_hold_impl_init(dh, dn, level, blkid, fail_sparse, tag, dbp, 0);

error = __dbuf_hold_impl(dh);
Expand Down
8 changes: 4 additions & 4 deletions module/zfs/ddt.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ ddt_get_dedup_stats(spa_t *spa, ddt_stat_t *dds_total)
{
ddt_histogram_t *ddh_total;

ddh_total = kmem_zalloc(sizeof (ddt_histogram_t), KM_PUSHPAGE);
ddh_total = kmem_zalloc(sizeof (ddt_histogram_t), KM_SLEEP);
ddt_get_dedup_histogram(spa, ddh_total);
ddt_histogram_stat(dds_total, ddh_total);
kmem_free(ddh_total, sizeof (ddt_histogram_t));
Expand Down Expand Up @@ -685,7 +685,7 @@ ddt_alloc(const ddt_key_t *ddk)
{
ddt_entry_t *dde;

dde = kmem_cache_alloc(ddt_entry_cache, KM_PUSHPAGE);
dde = kmem_cache_alloc(ddt_entry_cache, KM_SLEEP);
bzero(dde, sizeof (ddt_entry_t));
cv_init(&dde->dde_cv, NULL, CV_DEFAULT, NULL);

Expand Down Expand Up @@ -834,7 +834,7 @@ ddt_table_alloc(spa_t *spa, enum zio_checksum c)
{
ddt_t *ddt;

ddt = kmem_cache_alloc(ddt_cache, KM_PUSHPAGE);
ddt = kmem_cache_alloc(ddt_cache, KM_SLEEP);
bzero(ddt, sizeof (ddt_t));

mutex_init(&ddt->ddt_lock, NULL, MUTEX_DEFAULT, NULL);
Expand Down Expand Up @@ -937,7 +937,7 @@ ddt_class_contains(spa_t *spa, enum ddt_class max_class, const blkptr_t *bp)
return (B_TRUE);

ddt = spa->spa_ddt[BP_GET_CHECKSUM(bp)];
dde = kmem_cache_alloc(ddt_entry_cache, KM_PUSHPAGE);
dde = kmem_cache_alloc(ddt_entry_cache, KM_SLEEP);

ddt_key_fill(&(dde->dde_key), bp);

Expand Down
2 changes: 1 addition & 1 deletion module/zfs/ddt_zap.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ddt_zap_lookup(objset_t *os, uint64_t object, ddt_entry_t *dde)
uint64_t one, csize;
int error;

cbuf = kmem_alloc(sizeof (dde->dde_phys) + 1, KM_PUSHPAGE);
cbuf = kmem_alloc(sizeof (dde->dde_phys) + 1, KM_SLEEP);

error = zap_length_uint64(os, object, (uint64_t *)&dde->dde_key,
DDT_KEY_WORDS, &one, &csize);
Expand Down
12 changes: 6 additions & 6 deletions module/zfs/dmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length,
}
nblks = 1;
}
dbp = kmem_zalloc(sizeof (dmu_buf_t *) * nblks, KM_PUSHPAGE);
dbp = kmem_zalloc(sizeof (dmu_buf_t *) * nblks, KM_SLEEP);

zio = zio_root(dn->dn_objset->os_spa, NULL, NULL, ZIO_FLAG_CANFAIL);
blkid = dbuf_whichblock(dn, offset);
Expand Down Expand Up @@ -924,11 +924,11 @@ dmu_xuio_init(xuio_t *xuio, int nblk)
uio_t *uio = &xuio->xu_uio;

uio->uio_iovcnt = nblk;
uio->uio_iov = kmem_zalloc(nblk * sizeof (iovec_t), KM_PUSHPAGE);
uio->uio_iov = kmem_zalloc(nblk * sizeof (iovec_t), KM_SLEEP);

priv = kmem_zalloc(sizeof (dmu_xuio_t), KM_PUSHPAGE);
priv = kmem_zalloc(sizeof (dmu_xuio_t), KM_SLEEP);
priv->cnt = nblk;
priv->bufs = kmem_zalloc(nblk * sizeof (arc_buf_t *), KM_PUSHPAGE);
priv->bufs = kmem_zalloc(nblk * sizeof (arc_buf_t *), KM_SLEEP);
priv->iovp = uio->uio_iov;
XUIO_XUZC_PRIV(xuio) = priv;

Expand Down Expand Up @@ -1530,7 +1530,7 @@ dmu_sync_late_arrival(zio_t *pio, objset_t *os, dmu_sync_cb_t *done, zgd_t *zgd,
return (SET_ERROR(EIO));
}

dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_PUSHPAGE);
dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_SLEEP);
dsa->dsa_dr = NULL;
dsa->dsa_done = done;
dsa->dsa_zgd = zgd;
Expand Down Expand Up @@ -1670,7 +1670,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_sync_cb_t *done, zgd_t *zgd)
dr->dt.dl.dr_override_state = DR_IN_DMU_SYNC;
mutex_exit(&db->db_mtx);

dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_PUSHPAGE);
dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_SLEEP);
dsa->dsa_dr = dr;
dsa->dsa_done = done;
dsa->dsa_zgd = zgd;
Expand Down
6 changes: 3 additions & 3 deletions module/zfs/dmu_objset.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dataset_t *ds, blkptr_t *bp,

ASSERT(ds == NULL || MUTEX_HELD(&ds->ds_opening_lock));

os = kmem_zalloc(sizeof (objset_t), KM_PUSHPAGE);
os = kmem_zalloc(sizeof (objset_t), KM_SLEEP);
os->os_dsl_dataset = ds;
os->os_spa = spa;
os->os_rootbp = bp;
Expand Down Expand Up @@ -1573,7 +1573,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint64_t ddobj,
}

thisobj = dd->dd_phys->dd_head_dataset_obj;
attr = kmem_alloc(sizeof (zap_attribute_t), KM_PUSHPAGE);
attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP);

/*
* Iterate over all children.
Expand Down Expand Up @@ -1685,7 +1685,7 @@ dmu_objset_find_impl(spa_t *spa, const char *name,
}

thisobj = dd->dd_phys->dd_head_dataset_obj;
attr = kmem_alloc(sizeof (zap_attribute_t), KM_PUSHPAGE);
attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP);

/*
* Iterate over all children.
Expand Down
8 changes: 4 additions & 4 deletions module/zfs/dmu_traverse.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
if (err != 0)
goto post;

czb = kmem_alloc(sizeof (zbookmark_phys_t), KM_PUSHPAGE);
czb = kmem_alloc(sizeof (zbookmark_phys_t), KM_SLEEP);

for (i = 0; i < epb; i++) {
SET_BOOKMARK(czb, zb->zb_objset, zb->zb_object,
Expand Down Expand Up @@ -517,9 +517,9 @@ traverse_impl(spa_t *spa, dsl_dataset_t *ds, uint64_t objset, blkptr_t *rootbp,
*/
ASSERT(resume == NULL || !(flags & TRAVERSE_PREFETCH_DATA));

td = kmem_alloc(sizeof (traverse_data_t), KM_PUSHPAGE);
pd = kmem_zalloc(sizeof (prefetch_data_t), KM_PUSHPAGE);
czb = kmem_alloc(sizeof (zbookmark_phys_t), KM_PUSHPAGE);
td = kmem_alloc(sizeof (traverse_data_t), KM_SLEEP);
pd = kmem_zalloc(sizeof (prefetch_data_t), KM_SLEEP);
czb = kmem_alloc(sizeof (zbookmark_phys_t), KM_SLEEP);

td->td_spa = spa;
td->td_objset = objset;
Expand Down
6 changes: 3 additions & 3 deletions module/zfs/dmu_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static kstat_t *dmu_tx_ksp;
dmu_tx_t *
dmu_tx_create_dd(dsl_dir_t *dd)
{
dmu_tx_t *tx = kmem_zalloc(sizeof (dmu_tx_t), KM_PUSHPAGE);
dmu_tx_t *tx = kmem_zalloc(sizeof (dmu_tx_t), KM_SLEEP);
tx->tx_dir = dd;
if (dd != NULL)
tx->tx_pool = dd->dd_pool;
Expand Down Expand Up @@ -141,7 +141,7 @@ dmu_tx_hold_object_impl(dmu_tx_t *tx, objset_t *os, uint64_t object,
}
}

txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_PUSHPAGE);
txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_SLEEP);
txh->txh_tx = tx;
txh->txh_dnode = dn;
#ifdef DEBUG_DMU_TX
Expand Down Expand Up @@ -1467,7 +1467,7 @@ dmu_tx_callback_register(dmu_tx_t *tx, dmu_tx_callback_func_t *func, void *data)
{
dmu_tx_callback_t *dcb;

dcb = kmem_alloc(sizeof (dmu_tx_callback_t), KM_PUSHPAGE);
dcb = kmem_alloc(sizeof (dmu_tx_callback_t), KM_SLEEP);

dcb->dcb_func = func;
dcb->dcb_data = data;
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/dmu_zfetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset, uint64_t size, int prefetched)
return;
}
newstream =
kmem_zalloc(sizeof (zstream_t), KM_PUSHPAGE);
kmem_zalloc(sizeof (zstream_t), KM_SLEEP);
}

newstream->zst_offset = zst.zst_offset;
Expand Down
4 changes: 2 additions & 2 deletions module/zfs/dnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ static dnode_t *
dnode_create(objset_t *os, dnode_phys_t *dnp, dmu_buf_impl_t *db,
uint64_t object, dnode_handle_t *dnh)
{
dnode_t *dn = kmem_cache_alloc(dnode_cache, KM_PUSHPAGE);
dnode_t *dn = kmem_cache_alloc(dnode_cache, KM_SLEEP);

ASSERT(!POINTER_IS_VALID(dn->dn_objset));
dn->dn_moved = 0;
Expand Down Expand Up @@ -1070,7 +1070,7 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag,
int i;
dnode_children_t *winner;
children_dnodes = kmem_alloc(sizeof (dnode_children_t) +
(epb - 1) * sizeof (dnode_handle_t), KM_PUSHPAGE);
(epb - 1) * sizeof (dnode_handle_t), KM_SLEEP);
children_dnodes->dnc_count = epb;
dnh = &children_dnodes->dnc_children[0];
for (i = 0; i < epb; i++) {
Expand Down
Loading

0 comments on commit 79c76d5

Please sign in to comment.