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...
--