Re: use of preempt_count instead of in_atomic() at leds-gpio.c

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Tetsuo Handa <penguin-kernel@...>
Cc: <akpm@...>, <linux-kernel@...>
Date: Friday, March 21, 2008 - 12:54 pm

Tetsuo Handa wrote:

You shouldn't sleep while holding a spinlock.  As soon as another thread 
attempts to take the spinlock, it will be stuck in a busy-wait loop.

So, it's better if you specify that your code either can be called in 
atomic context or must not be called in atomic context, and all callers 
observe this restriction.  Or callers pass a flag to your code which 
says whether your code is allowed to sleep or not.
-- 
Stefan Richter
-=====-==--- --== =-=-=
http://arcgraph.de/sr/
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes Holschuh..., (Sun Mar 16, 2:43 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes Holschuh..., (Thu Mar 20, 6:56 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes Holschuh..., (Thu Mar 20, 10:10 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes Holschuh..., (Thu Mar 20, 8:36 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes Holschuh..., (Fri Mar 21, 8:37 am)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Stefan Richter, (Fri Mar 21, 12:54 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes Holschuh..., (Wed Mar 26, 12:17 pm)