From 2ade02b162a35dce0bb6864bd9248aaa90309093 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Sun, 21 Aug 2016 08:22:32 -0500 Subject: [PATCH] Prevent reclaim in send_traverse_thread() 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 Signed-off-by: Brian Behlendorf Closes #4912 Closes #4998 --- module/zfs/dmu_send.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index 7dc62dc208d5..b4d8a0c48c03 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -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, @@ -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); } /* @@ -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)) { /* @@ -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); } /*