On Friday 09 June 2006 23:48, Ingo Molnar wrote: > * Darren Hart wrote: > > @@ -1543,6 +1543,17 @@ static int try_to_wake_up(task_t *p, uns > > } > > } > > > > + /* > > + * XXX Don't send RT task elsewhere unless it can preempt current > > + * XXX on other CPU. Better yet would be for awakened RT tasks to > > + * XXX examine this(and all other) CPU(s) to see what is the best > > + * XXX fit. For example there is no check here to see if the > > + * XXX currently running task can be preempted (which would be the > > + * XXX ideal case). > > + */ > > + if (rt_task(p) && !TASK_PREEMPTS_CURR(p, rq)) > > + goto out_set_cpu; > > + > > Great testcase! Note that we already do RT-overload wakeups further > below: > > /* > * If a newly woken up RT task cannot preempt the > * current (RT) task then try to find another > * CPU it can preempt: > */ > if (rt_task(p) && !TASK_PREEMPTS_CURR(p, rq)) { > smp_send_reschedule_allbutself(); > rt_overload_wakeup++; > } > > what i think happened is that the above logic misses the case you have > described in detail, and doesnt mark the current CPU for rescheduling. > > I.e. it sends an IPI to all _other_ CPUs, including the 'wrong target' - > but it doesnt mark the current CPU for reschedule - hence if the current > CPU is the only right target we might fail to handle this task! > > could you try the (untested) patch below, does it solve your testcase > too? Thanks for the updated patch! It wouldn't quite build (proc_misc.c still referenced the old rt_overload_* variables, fixup patch attached removing those print statements). I have it running on a 4 way opteron box running prio-preempt in a timed while loop, exiting only on failure. It's been running fine for several minutes - usually fails in under a mintue. We'll see how it's doing in the morning :-) -- Darren Hart IBM Linux Technology Center Realtime Linux Team