Re: error : preempt_count 1

Robert Love (rml@tech9.net)
14 May 2002 09:24:57 -0700


On Tue, 2002-05-14 at 09:45, Denis Vlasenko wrote:

> On 13 May 2002 14:18, Robert Love wrote:
>
> > Absolutely nothing bad. It is a debugging check to catch bad code that
> > does funny things with locks. Ideally, every program should call unlock
> > for each instance it called lock - balancing everything out and giving a
> > preempt_count of zero.
>
> > Some code in the kernel, knowing it is shutting down, does not bother to
> > drop any held locks and subsequently you see that message.
>
> > Since it is triggering false positives, I will remove it eventually.
>
> I'd say don't remove it, just omit the 'error:' part - this will
> reduce panic mails on the subject.
>
> > For now it is incredibly useful for catching real problems. And the
> > above, while harmless, could be fixed for "cleanliness" concerns.

Not a bad idea ;-)

For now this will hopefully curb the inquiries - I can still remove it
later when I am confident that the core code is sane and if people still
whine.

Thanks,

Robert Love

--- linux-2.5.15/kernel/exit.c Sun May 5 20:37:59 2002
+++ linux/kernel/exit.c Tue May 14 09:22:52 2002
@@ -526,7 +526,7 @@
del_timer_sync(&tsk->real_timer);

if (unlikely(preempt_get_count()))
- printk(KERN_ERR "error: %s[%d] exited with preempt_count %d\n",
+ printk(KERN_ERR "%s[%d] exited with preempt_count %d\n",
current->comm, current->pid,
preempt_get_count());

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/