aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2005-11-15 03:09:12 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-15 11:59:19 -0500
commit93588e2284b6be1873cc0bb7fbf0947bdbf72830 (patch)
tree685a5b21312c6d057f1db37d75085944db646cb9
parente8a0033451f7972169b2f375be34d9d805ad8687 (diff)
[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: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/md/md.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a9f032e341cb..f3fed662f32e 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3437,10 +3437,19 @@ static int md_thread(void * arg)
3437 allow_signal(SIGKILL); 3437 allow_signal(SIGKILL);
3438 while (!kthread_should_stop()) { 3438 while (!kthread_should_stop()) {
3439 3439
3440 wait_event_timeout(thread->wqueue, 3440 /* We need to wait INTERRUPTIBLE so that
3441 test_bit(THREAD_WAKEUP, &thread->flags) 3441 * we don't add to the load-average.
3442 || kthread_should_stop(), 3442 * That means we need to be sure no signals are
3443 thread->timeout); 3443 * pending
3444 */
3445 if (signal_pending(current))
3446 flush_signals(current);
3447
3448 wait_event_interruptible_timeout
3449 (thread->wqueue,
3450 test_bit(THREAD_WAKEUP, &thread->flags)
3451 || kthread_should_stop(),
3452 thread->timeout);
3444 try_to_freeze(); 3453 try_to_freeze();
3445 3454
3446 clear_bit(THREAD_WAKEUP, &thread->flags); 3455 clear_bit(THREAD_WAKEUP, &thread->flags);