* low-latency patch bug?
@ 2002-07-02 14:40 anton wilson
0 siblings, 0 replies; only message in thread
From: anton wilson @ 2002-07-02 14:40 UTC (permalink / raw)
To: Linux Kernel
I think I found a bug in the low latency patch. In reschedule_idle there is
code that it adds that looks like this:
/*1*/#if LOWLATENCY_NEEDED
/*2*/ if (enable_lowlatency && (p->policy != SCHED_OTHER)) {
/*3*/ struct task_struct *t;
/*4*/ for (i = 0; i < smp_num_cpus; i++) {
/*5*/ cpu = cpu_logical_map(i);
/*6*/ t = cpu_curr(cpu);
/*7*/ if (t != tsk) //<------BUG
/*8*/ t->need_resched = 1;
/*9*/ }
/*10*/ }
/*11*/#endif
This code does not check to see if tsk (target_tsk) is NULL at line 7.
Therefore, the scheduler will try to reschedule even if tsk == NULL. In the
worst case, if your process selection loop finds a different process to run
everytime, and tsk is always NULL, the scheduler will enter an infinite loop.
I ran into this problem because I was pushing SCHED_RR tasks with the same
priority to the back of the runqueue everytime the scheduler was called.
Therefore a new process is found everytime and __schedule_tail is called
everytime, and therefore a infinite loop.
Anton Wilson
--
Camotion
Software Development
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-07-02 14:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-02 14:40 low-latency patch bug? anton wilson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.