Skip to content

Commit

Permalink
Switch allocations from KM_SLEEP to KM_PUSHPAGE
Browse files Browse the repository at this point in the history
A couple of kmem_alloc() allocations were using KM_SLEEP in
the sync thread context.  These were accidentally introduced
by the recent set of Illumos patches.  The solution is to
switch to KM_PUSHPAGE.

dsl_dataset_promote_sync() -> promote_hold() -> snaplist_make() ->
kmem_alloc(sizeof (*snap), KM_SLEEP);

dsl_dataset_user_hold_sync() -> dsl_onexit_hold_cleanup() ->
kmem_alloc(sizeof (*ca), KM_SLEEP)

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#1775
  • Loading branch information
behlendorf authored and unya committed Dec 13, 2013
1 parent 27792e7 commit 41952ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion module/zfs/dsl_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@ snaplist_make(dsl_pool_t *dp,
if (first_obj == 0)
first_obj = ds->ds_dir->dd_phys->dd_origin_obj;

snap = kmem_alloc(sizeof (*snap), KM_SLEEP);
snap = kmem_alloc(sizeof (*snap), KM_PUSHPAGE);
snap->ds = ds;
list_insert_tail(l, snap);
obj = ds->ds_phys->ds_prev_snap_obj;
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/dsl_userhold.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ dsl_onexit_hold_cleanup(spa_t *spa, nvlist_t *holds, minor_t minor)
}

ASSERT(spa != NULL);
ca = kmem_alloc(sizeof (*ca), KM_SLEEP);
ca = kmem_alloc(sizeof (*ca), KM_PUSHPAGE);

(void) strlcpy(ca->zhca_spaname, spa_name(spa),
sizeof (ca->zhca_spaname));
Expand Down

0 comments on commit 41952ea

Please sign in to comment.