[PATCH] Avoid moving tasks when a schedule can be made.
- From: Steven Rostedt <rostedt@xxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 14:43:29 -0500
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@xxxxxxxxxxx>
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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Prev by Date: Re: GPL V3 and Linux - Dead Copyright Holders
- Next by Date: Re: GPL V3 and Linux - Dead Copyright Holders
- Previous by thread: [PATCH] Fix compile error in latest git pull - post 2.6.16-rc1-git4
- Next by thread: [patch 0/6] Add MMC password protection (lock/unlock) support V4
- Index(es):
Relevant Pages
- [patch] voluntary-preempt-2.6.9-rc1-bk4-Q7
... the main change in this patch are more SMP latency fixes. ... kernel, even with
CONFIG_PREEMPT enabled, didnt have any spin-nicely ... CPUs in the system. ...
(Linux-Kernel) - Re: [PATCH] Fix longstanding load balancing bug in the scheduler.
... out the latency of a balancing operation. ... And we do tend to care about theoretical
max latency ... in many other obscure paths than the scheduler. ... How about
if you have N/2 CPUs with lots of stuff on runqueues? ... (Linux-Kernel) - Re: Zahl gerade oder ungerade?
... für aktuelle intel Core2 CPUs ... AND/OR/XOR: ... Latency:
1 Throughput 0.33 ... (microsoft.public.de.german.entwickler.dotnet.vb) - Re: [patch] latency tracer, 2.6.15-rc7
... >> This should help in UP configurations, or in SMP configurations where ...
>> it to help in cases where one of several CPUs is frequently executing ... >
took ~48 hours to show up in the latency tracer. ... most old-style server workloads
wouldn't notice a 10ms hit to ... (Linux-Kernel) - Re: [RFC] maximum latency tracking infrastructure
... operation that requires the given latency? ... would block the caller until
all CPUs are set to wake within this ... That would be the API semantics I would
expect, ... the non-blocking variant. ... (Linux-Kernel)