public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Avoid moving tasks when a schedule can be made.
@ 2006-01-31 19:43 Steven Rostedt
  2006-02-01  3:36 ` Peter Williams
  2006-02-01 13:08 ` Ingo Molnar
  0 siblings, 2 replies; 33+ messages in thread
From: Steven Rostedt @ 2006-01-31 19:43 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Thomas Gleixner, Andrew Morton, LKML

I found this in the -rt kernel.  While running "hackbench 20" I hit
latencies of over 1.5 ms.  That is huge!  This latency was created by
the move_tasks function in sched.c to rebalance the queues over CPUS.  

There currently isn't any check in this function to see if it should
stop, thus a large number of tasks can drive the latency high.

With the below patch, (tested on -rt with latency tracing), the latency
caused by hackbench disappeared below my notice threshold (100 usecs).

I'm not convinced that this bail out is in the right location, but it
worked where it is.  Comments are welcome.

-- Steve

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

Index: linux-2.6.16-rc1/kernel/sched.c
===================================================================
--- linux-2.6.16-rc1.orig/kernel/sched.c	2006-01-19 15:58:52.000000000 -0500
+++ linux-2.6.16-rc1/kernel/sched.c	2006-01-31 14:27:17.000000000 -0500
@@ -1983,6 +1983,10 @@
 
 	curr = curr->prev;
 
+	/* bail if someone else woke up */
+	if (need_resched())
+		goto out;
+
 	if (!can_migrate_task(tmp, busiest, this_cpu, sd, idle, &pinned)) {
 		if (curr != head)
 			goto skip_queue;



^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2006-02-06 11:22 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-31 19:43 [PATCH] Avoid moving tasks when a schedule can be made Steven Rostedt
2006-02-01  3:36 ` Peter Williams
2006-02-01 12:44   ` Steven Rostedt
2006-02-01 13:06     ` Nick Piggin
2006-02-01 13:10       ` Nick Piggin
2006-02-01 13:20         ` Ingo Molnar
2006-02-01 13:47           ` Nick Piggin
2006-02-01 13:54             ` Nick Piggin
2006-02-01 14:12               ` Ingo Molnar
2006-02-01 14:25                 ` Nick Piggin
2006-02-01 14:37                   ` Ingo Molnar
2006-02-01 14:54                     ` Nick Piggin
2006-02-01 15:11                       ` Ingo Molnar
2006-02-01 15:31                         ` Nick Piggin
2006-02-01 16:10                           ` Ingo Molnar
2006-02-01 16:25                             ` Nick Piggin
2006-02-01 17:24                               ` Ingo Molnar
2006-02-06 11:21                                 ` Nick Piggin
2006-02-01 14:00             ` Ingo Molnar
2006-02-01 14:09               ` Nick Piggin
2006-02-01 14:22                 ` Ingo Molnar
2006-02-01 14:32                   ` Steven Rostedt
2006-02-02  1:26     ` Peter Williams
2006-02-02  2:48       ` Steven Rostedt
2006-02-02  3:19         ` Peter Williams
2006-02-01 13:08 ` Ingo Molnar
2006-02-01 13:11   ` Ingo Molnar
2006-02-02  1:42     ` Peter Williams
2006-02-02  2:51       ` Steven Rostedt
2006-02-01 13:15   ` Steven Rostedt
2006-02-01 13:23   ` Steven Rostedt
2006-02-01 13:26     ` Ingo Molnar
2006-02-01 16:11       ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox