Re: [patch] irqlock patch -G3. [was Re: odd memory corruption in2.5.27?]

Andrew Morton (akpm@zip.com.au)
Tue, 23 Jul 2002 20:13:42 -0700


Robert Love wrote:
>
> ...
> Attached is the patch George mentioned, against 2.5.27.
>

I'd agree with Robert on that. The idea should be that,
as much as possible, preempt "just works" as long as the
programmer sticks with standard SMP programming practices.

And yet here we have a case where a spin_unlock() will
go and turn on local interrupts. Only with CONFIG_PREEMPT,
and even then, extremely rarely.

Plus it would be nice to have an arch-independent way of
querying whether the current CPU has interrupts enabled.
I've needed that several times within debug/devel code.

Robert and George's patch doesn't seem to be optimal though - if
we're not going to preempt at spin_unlock() time, we need to
preempt at local_irq_restore() time. It'll be untrivial to fix
all this, but this very subtle change to the locking semantics
with CONFIG_PREEMPT is quite nasty.

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/