Re: [PATCH] sched_yield() flawed since 2.2.13?

From: Giuseppe Ciaccio (ciaccio@disi.unige.it)
Date: Fri May 19 2000 - 12:09:38 EST


On Fri, 19 May 2000, George Anzinger wrote:

> There have been numerous proposals around this (and several related)
> problem(s). I suggest you look up the discussion in the digest.
>
> The principle problem with your patch is that it introduces more code in
> the inner schedule loop. A different approach might be to:
> a.) Set the counter to zero for a sched yield process,
> b.) Do the sched loop
> c.) Reset the counter to its prior value

Step a) could be easily performed in sys_sched_yield(); this routine
also set current->need_resched, so as to trigger a call to schedule()
(step b) upon return. However I don't see how to reset the counter to its
original value (step c) without adding more code to schedule(), given that
sys_sched_yield() has already returned when schedule() is called.

My apologies for not having searched the (huge) linux-kernel archive before
posting my patch. However, IMO it is bad thing that the sched_yield() flaw
have remained in the kernel despite of the "numerous proposals around this".
I understand the need for keeping the schedule() code as much straightforward
as possible, but IMO this cannot justify a wrong semantics for sched_yield().

Giuseppe

Giuseppe Ciaccio http://www.disi.unige.it/person/CiaccioG/
DISI - Universita' di Genova via Dodecaneso 35 16146 Genova, Italy
phone +39 10 353 6638 fax +39 010 3536699 ciaccio@disi.unige.it
------------------------------------------------------------------------

-
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 : Tue May 23 2000 - 21:00:17 EST