diff options
author | Shaohua Li | 2016-11-21 19:29:18 +0100 |
---|---|---|
committer | Shaohua Li | 2016-11-24 04:30:06 +0100 |
commit | ce1ccd079fac0336191c0fd516ebf0e4985d59d4 (patch) | |
tree | 4d1f847d7fdfe2d0882e0e900c2b543b76bc5890 /drivers/md/md.c | |
parent | md/raid10: add failfast handling for writes. (diff) | |
download | kernel-qcow2-linux-ce1ccd079fac0336191c0fd516ebf0e4985d59d4.tar.gz kernel-qcow2-linux-ce1ccd079fac0336191c0fd516ebf0e4985d59d4.tar.xz kernel-qcow2-linux-ce1ccd079fac0336191c0fd516ebf0e4985d59d4.zip |
raid5-cache: suspend reclaim thread instead of shutdown
There is mechanism to suspend a kernel thread. Use it instead of playing
create/destroy game.
Signed-off-by: Shaohua Li <shli@fb.com>
Reviewed-by: NeilBrown <neilb@suse.de>
Cc: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 62f3fb948b3e..297757a0ec0c 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -7187,10 +7187,12 @@ static int md_thread(void *arg) wait_event_interruptible_timeout (thread->wqueue, test_bit(THREAD_WAKEUP, &thread->flags) - || kthread_should_stop(), + || kthread_should_stop() || kthread_should_park(), thread->timeout); clear_bit(THREAD_WAKEUP, &thread->flags); + if (kthread_should_park()) + kthread_parkme(); if (!kthread_should_stop()) thread->run(thread); } |