Subject: Re: [patch] preemptive kernel, preemptive-2.3.52-A7
From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Mar 14 2000 - 10:07:13 PST
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
This archive was generated by hypermail 2a22 : Sat Apr 01 2000 - 04:15:04 PST