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

From: Andrea Arcangeli (andrea@suse.de)
Date: Mon Sep 11 2000 - 20:43:26 EST


On Mon, 11 Sep 2000, Rik van Riel wrote:

>Hmmm, maybe the Montavista people can volunteer to clean
>up all those places in the kernel code? ;)

That would be nice and welcome indipendently of the preemptible kernel
indeed. The right construct to convert that stuff is
spin_is_locked/spin_trylock (so spin_trylock will take care to forbid
kernel reschedules within the critical section).

One example that cames to mind to better show what this cleanup consists
of (not a matter to this case because it's code that doesn't get compiled
in UP) is the global_irq_lock variable. The i386 one is the example of the
old style one and the alpha one is the new style spin_is_locked/trylock
one.

The new rule should be that places that uses test_and_set_bit should never
spin. They can be of course schedule-locks like lock_page() (infact being
a schedule aware lock still means not to spin on the lock :).

Those cleanups can start in the 2.4.x timeframe but I'd rather not depend
on them during 2.4.x to have a stable kernel. (2.5.x looks a better time
to change such an ancient API) This is just my humble opinion of course.

Andrea

-
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