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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Thursday, March 20, 2008 - 8:17 pm

On Thu, 20 Mar 2008 23:07:16 -0400 (EDT) Alan Stern <stern@rowland.harvard.edu> wrote:


in_atomic() is for core kernel use only.  Because in special circumstances
(ie: kmap_atomic()) we run inc_preempt_count() even on non-preemptible
kernels to tell the per-arch fault handler that it was invoked by
copy_*_user() inside kmap_atomic(), and it must fail.


That's correct.


The reasons I identified: it adds additional overhead and it encourages
poorly-thought-out design.

Now we _could_ change kernel design principles from
caller-knows-whats-going-on over to callee-works-out-whats-going-on.  But
that would affect more than this particular thing.


The vast, vast majority of kernel code has managed to get through life
without needing this hidden-argument-passing.  The handful of errant
callsites should be able to do so as well...

--
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 H ..., (Sun Mar 16, 11:43 am)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Thu Mar 20, 3:56 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Thu Mar 20, 5:36 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Thu Mar 20, 7:10 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Andrew Morton, (Thu Mar 20, 8:17 pm)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Fri Mar 21, 5:37 am)
Re: use of preempt_count instead of in_atomic() at leds-gpio.c, Henrique de Moraes H ..., (Wed Mar 26, 9:17 am)