[lkml]   [2002]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: BUG(): sched.c: Line 944 - 2.5.35
On Mon, 2002-09-16 at 12:36, Adam J. Richter wrote:

> When I see this problem at boot, preempt_count() returns 0x4000000
> (PREEMPT_ACTIVE) and kernel_locked() returns 0.
> I don't understand the semantics of PREEMPT_ACTIVE to know
> whether to
> (1) change the test back to using in_interrupt instead of in_atomic, or
> (2) change the definition of in_atomic(), or
> (3) look for a bug somewhere else.

There are two problems: First, PREEMPT_ACTIVE is indeed set on entry to
schedule() from preempt_schedule() so we need to check for that too.
Second, the BUG() is catching a bit of issues... you want something

- if (unlikely(in_atomic()))
- BUG();
+ if (unlikely(in_atomic() && preempt_count() != PREEMPT_ACTIVE)) {
+ printk(KERN_ERR "schedule() called while non-atomic!\n");
+ show_stack(NULL);
+ }

I will send a patch to Linus.

> However, I know experimentally that changing the test back to
> using in_interrupt() results in a possibly unrelated BUG() at line 279
> of rmap.c:

This is unrelated.

Robert Love

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.263 / U:2.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site