All of lore.kernel.org
 help / color / mirror / Atom feed
From: janitor@sternwelten.at
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, janitor@sternwelten.at, domen@coderock.org
Subject: [patch 3/8]  kernel/sched.c: fix subtle TASK_RUNNING compare
Date: Sat, 20 Nov 2004 03:29:33 +0100	[thread overview]
Message-ID: <E1CVL0H-0000SH-EN@sputnik> (raw)



Hi.

This test was depending on TASK_RUNNING being defined as 0.

Signed-off-by: Domen Puncer <domen@coderock.org>

Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
---

 linux-2.6.10-rc2-bk4-max/kernel/sched.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN kernel/sched.c~fix-test-kernel_sched kernel/sched.c
--- linux-2.6.10-rc2-bk4/kernel/sched.c~fix-test-kernel_sched	2004-11-20 03:04:46.000000000 +0100
+++ linux-2.6.10-rc2-bk4-max/kernel/sched.c	2004-11-20 03:04:46.000000000 +0100
@@ -2576,7 +2576,8 @@ need_resched_nonpreemptible:
 	 * to picking the next task.
 	 */
 	switch_count = &prev->nivcsw;
-	if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
+	if (prev->state != TASK_RUNNING &&
+			!(preempt_count() & PREEMPT_ACTIVE)) {
 		switch_count = &prev->nvcsw;
 		if (unlikely((prev->state & TASK_INTERRUPTIBLE) &&
 				unlikely(signal_pending(prev))))
_

             reply	other threads:[~2004-11-20  5:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-20  2:29 janitor [this message]
2004-11-20 12:53 ` [patch 3/8] kernel/sched.c: fix subtle TASK_RUNNING compare Ingo Molnar
2004-11-20 12:07   ` Domen Puncer
2004-11-20 16:40     ` Ingo Molnar

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=E1CVL0H-0000SH-EN@sputnik \
    --to=janitor@sternwelten.at \
    --cc=akpm@osdl.org \
    --cc=domen@coderock.org \
    --cc=linux-kernel@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.