提交 93588e22 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[PATCH] md: make md threads interruptible again

Despite the fact that md threads don't need to be signalled, and won't
respond to signals anyway, we need to have an 'interruptible' wait, else
they stay in 'D' state and add to the load average.

(akpm: the signal_pending() test is unneeded - we'll fix that up in the next
round.  For now, leave it there because that's how the code used to be).
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e8a00334
...@@ -3437,10 +3437,19 @@ static int md_thread(void * arg) ...@@ -3437,10 +3437,19 @@ static int md_thread(void * arg)
allow_signal(SIGKILL); allow_signal(SIGKILL);
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
wait_event_timeout(thread->wqueue, /* We need to wait INTERRUPTIBLE so that
test_bit(THREAD_WAKEUP, &thread->flags) * we don't add to the load-average.
|| kthread_should_stop(), * That means we need to be sure no signals are
thread->timeout); * pending
*/
if (signal_pending(current))
flush_signals(current);
wait_event_interruptible_timeout
(thread->wqueue,
test_bit(THREAD_WAKEUP, &thread->flags)
|| kthread_should_stop(),
thread->timeout);
try_to_freeze(); try_to_freeze();
clear_bit(THREAD_WAKEUP, &thread->flags); clear_bit(THREAD_WAKEUP, &thread->flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册