Re: PROBLEM: in_atomic() misuse all over the place

From: Pavel Machek
Date: Thu Feb 05 2009 - 10:14:21 EST


On Wed 2009-01-28 00:10:37, Roger Larsson wrote:
> (resent, non html)
>
> [1.] One line summary of the problem:
> in_atomic() is used to select path of execution, most likely to suppress
> warning logs when running a preemptive kernel.
>
> [2.] Full description of the problem/report:
>
> The problem is that in_atomic() only works on preemptive kernels...
>
> Result: preemptive kernel warns about a potential deadlock in all kernels,
> developer silence with the help of in_atomic()
> bug remains in SMP/UP kernels...

I guess in_atomic() should be renamed to
unreliable_in_atomic... because it does not really reliably tell you
if you are in atomic section or not.

Or we could negate the logic and call it maybe_kernel_context()?

gfp_any() also needs a better
name. pick_right_gfp_if_you_are_in_kernel_or_softirq_context() sounds
suitable :-).

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/