mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.6.12-rc2 in_atomic() picks up preempt_disable()
@ 2005-04-07 10:10 Keith Owens
  2005-04-07 10:17 ` Arjan van de Ven
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Keith Owens @ 2005-04-07 10:10 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

2.6.12-rc2, with CONFIG_PREEMPT and CONFIG_PREEMPT_DEBUG.  The
in_atomic() macro thinks that preempt_disable() indicates an atomic
region so calls to __might_sleep() result in a stack trace.
preempt_count() returns 1, no soft or hard irqs are running and no
spinlocks are held.  It looks like there is no way to distinguish
between the use of preempt_disable() in the lock functions (atomic) and
preempt_disable() outside the lock functions (do nothing that might
migrate me).


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: 2.6.12-rc2 in_atomic() picks up preempt_disable()
@ 2005-04-07 18:40 Mikael Pettersson
  2005-04-07 18:59 ` Ingo Molnar
  2005-04-07 20:17 ` Arjan van de Ven
  0 siblings, 2 replies; 8+ messages in thread
From: Mikael Pettersson @ 2005-04-07 18:40 UTC (permalink / raw)
  To: arjan, kaos; +Cc: linux-kernel, mingo

On Thu, 07 Apr 2005 12:17:37 +0200, Arjan van de Ven wrote:
>On Thu, 2005-04-07 at 20:10 +1000, Keith Owens wrote:
>> 2.6.12-rc2, with CONFIG_PREEMPT and CONFIG_PREEMPT_DEBUG.  The
>> in_atomic() macro thinks that preempt_disable() indicates an atomic
>> region so calls to __might_sleep() result in a stack trace.
>
>but you're not allowed to schedule when preempt is disabled!

That sounds draconian. Where is that requirement stated?

A preempt-disabled region ought to have the same semantics
as in a CONFIG_PREEMPT=n kernel, and since schedule is Ok
in the latter case it should be Ok in the former too.

All that preempt_disable() should do is prevent involuntary
schedules. But the conditional schedules introduced by may-sleep
functions are _voluntary_, so there's no reason to forbid them.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-04-07 20:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-07 10:10 2.6.12-rc2 in_atomic() picks up preempt_disable() Keith Owens
2005-04-07 10:17 ` Arjan van de Ven
2005-04-07 12:24   ` Romano Giannetti
2005-04-07 10:22 ` Andrew Morton
2005-04-07 14:54 ` Ingo Molnar
2005-04-07 18:40 Mikael Pettersson
2005-04-07 18:59 ` Ingo Molnar
2005-04-07 20:17 ` Arjan van de Ven

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®