Re: [patch]2.4.0-test6 "spinlock" preemption patch

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Tue Sep 12 2000 - 05:37:46 EST


> > while (test_and_set_bit(0, &something)) {
> > /* critical section */
> > mb();
> > clear_bit(0, &something);
> > }
>
> > The above construct it's discouraged of course when you can do
> > the same thing with a spinlock but some place is doing that.
>
> Hmmm, maybe the Montavista people can volunteer to clean
> up all those places in the kernel code? ;)

That code example can in theory deadlock without any patches if the CPU's
end up locked in sync with each other and the same one always wins the test.
It isnt likely on current x86 but other processors are a different story

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



This archive was generated by hypermail 2b29 : Fri Sep 15 2000 - 21:00:17 EST