From: NeilBrown <neilb@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-raid@vger.kernel.org
Subject: [PATCH md 002 of 2] Make md threads interruptible again.
Date: Tue, 15 Nov 2005 12:56:41 +1100 [thread overview]
Message-ID: <1051115015641.9393@suse.de> (raw)
In-Reply-To: 20051115125442.9317.patches@notabene
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.
Signed-off-by: Neil Brown <neilb@suse.de>
### Diffstat output
./drivers/md/md.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2005-11-15 10:25:30.000000000 +1100
+++ ./drivers/md/md.c 2005-11-15 10:28:30.000000000 +1100
@@ -3437,10 +3437,19 @@ static int md_thread(void * arg)
allow_signal(SIGKILL);
while (!kthread_should_stop()) {
- wait_event_timeout(thread->wqueue,
- test_bit(THREAD_WAKEUP, &thread->flags)
- || kthread_should_stop(),
- thread->timeout);
+ /* We need to wait INTERRUPTIBLE so that
+ * we don't add to the load-average.
+ * That means we need to be sure no signals are
+ * 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();
clear_bit(THREAD_WAKEUP, &thread->flags);
next prev parent reply other threads:[~2005-11-15 1:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-15 1:56 [PATCH md 000 of 2] Introduction NeilBrown
2005-11-15 1:56 ` [PATCH md 001 of 2] Mark START_ARRAY deprecated with a date NeilBrown
2005-11-15 1:56 ` NeilBrown [this message]
2005-11-15 2:08 ` [PATCH md 002 of 2] Make md threads interruptible again Andrew Morton
2005-11-18 0:24 ` Neil Brown
2005-11-15 16:55 ` [PATCH md 000 of 2] Introduction Mr. James W. Laferriere
2005-11-17 5:12 ` Neil Brown
2005-11-17 16:19 ` Mr. James W. Laferriere
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1051115015641.9393@suse.de \
--to=neilb@suse.de \
--cc=akpm@osdl.org \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.