Re: [patch] preemptive kernel, preemptive-2.3.52-A7

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Mar 14 2000 - 13:07:13 EST


On Tue, 14 Mar 2000, Andrea Arcangeli wrote:
>
> Right, all the preemtable kernel code has to be definitely in
> TASK_RUNNING.

I disagree. There are lots of reasons to not have TASK_RUNNING (race
avoidance exactly when there are no locks held - mark it sleeping early on
the optimistic "we will loop" assumption).

The "let's mark the process sleeping early" approach has been a invaluable
tool to avoid races in both SMP and with interrupts. Let's not make the
same mistake that EVERY other OS makes in this area.

It's trivial to force it to be runnable at pre-emption time instead.
Simple rule: whenever the process gets scheduled for any reason except an
explicit call to schedule(), it must obviously have been RUNNING. Problem
solved.

                Linus

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



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:28 EST