Re: must-fix list for 2.6.0

Mike Galbraith
2003-05-01T03:05:07Z

At 12:11 PM 4/30/2003 -0700, Andrew Morton wrote:
>Maciej Soltysiak <solt@dns.toxicfilms.tv> wrote:
> >
> >
> > Also there is one issue, i am not sure if this may be a kernel issue,
> > but with setiathome running in a X desktop environment all apps work fine,
> > but when i run openoffice, openoffice responds with 5 second delay.
>
>That'll be the changed sched_yield() semantics.
>
>The below patch should fix that up, but we need to decide whether the (rather
>unclear) advantages of the sched_yield() change outweigh the breakage which
>it caused linuxthreads applications.
>
>
>diff -puN kernel/sched.c~sched_yield-hack kernel/sched.c
>--- 25/kernel/sched.c~sched_yield-hack 2003-04-30 12:08:51.000000000 -0700
>+++ 25-akpm/kernel/sched.c 2003-04-30 12:09:11.000000000 -0700
>@@ -1992,7 +1992,7 @@ asmlinkage long sys_sched_yield(void)
> */
> if (likely(!rt_task(current))) {
> dequeue_task(current, array);
>- enqueue_task(current, rq->expired);
>+ enqueue_task(current, array);
> } else {
> list_del(&current->run_list);
> list_add_tail(&current->run_list, array->queue +
> current->prio);
>
>_

That won't work, because the scheduler will keep re-selecting the yielding
task if it's interactive. I tried this yesterday. (besides, don't you
need to set_tsk_need_resched(current) there?) An easy way to see it not
work as expected, is to change CHILD_PENALTY to 99, and add
current->sleep_avg=MAX_SLEEP_AVG to sched_init() before
wake_up_forked_process(). Your next boot will 100% guaranteed hang while
starting ksoftirqd until the parent gets expired. You'll read "POSIX
conformance testing by UNIFIX" until then :)

-Mike