Messages in this thread | | | Date | Tue, 21 Mar 2000 10:38:05 -0800 | From | Jun Sun <> | Subject | Re: scheduler ignores need_resched flag in 2.2.x and 2.3.x? |
| |
William Montgomery wrote: > > The scenario you describe _is_ fixed by Ingo's patch, see below: > > ----------------- > in linux/kernel/sched.c - reschedule_idle_slow > int this_cpu = smp_processor_id(); > struct task_struct *tsk; > > - tsk = current; > + tsk = cpu_curr(this_cpu); > if (preemption_goodness(tsk, p, this_cpu) > 0) > tsk->need_resched = 1; > ----------------- > > This eliminates the race and is a bug which should be fixed in 2.2.x. > > The latest lowlatency patch can be found at: > http://www.redhat.com/~mingo/lowlatency-patches/lowlatency-2.2.15-C0 > > Wm
The above code DOES fix the problem I was describing.
Your email seems to suggest the above code also fix some other problems?
If we choose the above way to fix the lost need_resched flag, we would also need to apply the similar fix to two other functions for the SMP version :
1. smp_local_timer_interrupt() 2. update_process_times()
(I might miss one or two, but essentially all functions that a) can be called from interrupt context and b) need_resched flag is set to the CURRENT process need to be modified in a similar way.)
++++
If we were to fix *ONLY* the lost need_resched flag problem, I still like my fix a little better. However, if Ingo's fix has other benefits, we probably should take his.
Jun
- 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/
| |