Skip to content

Commit

Permalink
Prevent reclaim in send_traverse_thread()
Browse files Browse the repository at this point in the history
As is the case with traverse_prefetch_thread(), the deep stacks caused
by traversal require disabling reclaim in the send traverse thread.

Also, do the same for receive_writer_thread() in which similar problems
have been observed.

Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4912
Closes openzfs#4998
  • Loading branch information
dweeezil authored and unset committed Oct 19, 2016
1 parent 6e9cad4 commit 2ade02b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions module/zfs/dmu_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ send_traverse_thread(void *arg)
struct send_thread_arg *st_arg = arg;
int err;
struct send_block_record *data;
fstrans_cookie_t cookie = spl_fstrans_mark();

if (st_arg->ds != NULL) {
err = traverse_dataset(st_arg->ds, st_arg->fromtxg,
Expand All @@ -551,6 +552,7 @@ send_traverse_thread(void *arg)
data = kmem_zalloc(sizeof (*data), KM_SLEEP);
data->eos_marker = B_TRUE;
bqueue_enqueue(&st_arg->q, data, 1);
spl_fstrans_unmark(cookie);
}

/*
Expand Down Expand Up @@ -2308,6 +2310,8 @@ receive_writer_thread(void *arg)
{
struct receive_writer_arg *rwa = arg;
struct receive_record_arg *rrd;
fstrans_cookie_t cookie = spl_fstrans_mark();

for (rrd = bqueue_dequeue(&rwa->q); !rrd->eos_marker;
rrd = bqueue_dequeue(&rwa->q)) {
/*
Expand All @@ -2332,6 +2336,7 @@ receive_writer_thread(void *arg)
rwa->done = B_TRUE;
cv_signal(&rwa->cv);
mutex_exit(&rwa->mutex);
spl_fstrans_unmark(cookie);
}

/*
Expand Down

0 comments on commit 2ade02b

Please sign in to comment.