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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user