[PATCH RT] fix rt-task scheduling issue

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steven Rostedt
Date: Monday, October 8, 2007 - 7:46 pm

Mike,

Can you attach your Signed-off-by to this patch, please.


On Fri, Oct 05, 2007 at 07:15:48PM -0700, Mike Kravetz wrote:

I definitely agree with your analysis.


I'm thinking that the first change would actually make this one
obsolete. The checking at the time of scheduling should cover most cases
where multiple rt tasks are being queued on the same CPU.  When we see
that the rt tasks are bunching up on a queue we should handle it then.
Which I would think is at the time of schedule, and the time a task is
queued (try_to_wake_up). Hopefully this is enough.


I'm thinking it may have had little to no effect. The first change seems
to be the culprit.


I also don't want to put too many IPI reschedules when we see that we
have more than one rt task on queue. I can imaging an IPI scheduling
storm if we have one more rt tasks than CPUs. So sending the IPI when a
task switch actually occurs seems approriate.

-- Steve

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


Index: linux-2.6.23-rc9-rt2/kernel/sched.c
===================================================================
--- linux-2.6.23-rc9-rt2.orig/kernel/sched.c
+++ linux-2.6.23-rc9-rt2/kernel/sched.c
@@ -2207,7 +2207,7 @@ static inline void finish_task_switch(st
 	 * If we pushed an RT task off the runqueue,
 	 * then kick other CPUs, they might run it:
 	 */
-	if (unlikely(rt_task(current) && prev->se.on_rq && rt_task(prev))) {
+	if (unlikely(rt_task(current) && rq->rt_nr_running > 1)) {
 		schedstat_inc(rq, rto_schedule);
 		smp_send_reschedule_allbutself_cpumask(current->cpus_allowed);
 	}
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
-rt more realtime scheduling issues, Mike Kravetz, (Fri Oct 5, 7:15 pm)
Re: -rt more realtime scheduling issues, Mike Kravetz, (Mon Oct 8, 11:45 am)
[PATCH RT] fix rt-task scheduling issue, Steven Rostedt, (Mon Oct 8, 7:46 pm)
Re: -rt more realtime scheduling issues, Steven Rostedt, (Mon Oct 8, 8:04 pm)
Re: [PATCH RT] fix rt-task scheduling issue, Gregory Haskins, (Mon Oct 8, 9:18 pm)
Re: -rt more realtime scheduling issues, Peter Zijlstra, (Tue Oct 9, 1:16 am)
Re: -rt more realtime scheduling issues, Mike Kravetz, (Tue Oct 9, 11:49 am)
Re: [PATCH RT] fix rt-task scheduling issue, Mike Kravetz, (Tue Oct 9, 11:51 am)
Re: -rt more realtime scheduling issues, Steven Rostedt, (Wed Oct 10, 4:50 am)
Re: -rt more realtime scheduling issues, Mike Kravetz, (Wed Oct 10, 7:37 pm)