mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: "Fabio Comolli" <fabio.comolli@gmail.com>
Cc: "kernel list" <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: BUG: scheduling while atomic - Linux 2.6.20-rc2-ga3d89517
Date: Mon, 25 Dec 2006 01:58:09 +0900	[thread overview]
Message-ID: <87psa9z0wu.fsf@duaron.myhome.or.jp> (raw)
In-Reply-To: <b637ec0b0612240553n28b252c4p4c1559da794e646c@mail.gmail.com> (Fabio Comolli's message of "Sun\, 24 Dec 2006 08\:53\:48 -0500")

"Fabio Comolli" <fabio.comolli@gmail.com> writes:

> Just found this in syslog. It was during normal activity, about 6
> minutes after resume-from-ram. I never saw this before.

It seems someone missed to check PREEMPT_ACTIVE in __resched_legal().
Could you please test the following patch?
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>



Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 kernel/sched.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff -puN kernel/sched.c~__resched_legal kernel/sched.c
--- linux-2.6/kernel/sched.c~__resched_legal	2006-12-24 22:40:19.000000000 +0900
+++ linux-2.6-hirofumi/kernel/sched.c	2006-12-24 23:54:01.000000000 +0900
@@ -4619,10 +4619,11 @@ asmlinkage long sys_sched_yield(void)
 
 static inline int __resched_legal(int expected_preempt_count)
 {
-#ifdef CONFIG_PREEMPT
+#ifndef CONFIG_PREEMPT
+	expected_preempt_count = 0;
+#endif
 	if (unlikely(preempt_count() != expected_preempt_count))
 		return 0;
-#endif
 	if (unlikely(system_state != SYSTEM_RUNNING))
 		return 0;
 	return 1;
_

  reply	other threads:[~2006-12-24 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-24 13:53 Fabio Comolli
2006-12-24 16:58 ` OGAWA Hirofumi [this message]
2006-12-25 19:02   ` Fabio Comolli
2006-12-26 17:15     ` Pavel Machek
2006-12-26 17:25       ` Fabio Comolli
2006-12-26 17:27       ` Randy Dunlap
2006-12-26 13:07   ` [patch] sched: remove __resched_legal() and fix cond_resched_softirq() Ingo Molnar
2006-12-27  7:56     ` OGAWA Hirofumi
2006-12-27 11:16       ` 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=87psa9z0wu.fsf@duaron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=fabio.comolli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®