Volanomark slows by 80% under CFS

Tim Chen
2007-07-27T23:55:23Z

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

Ingo,

Volanomark slows by 80% with CFS scheduler on 2.6.23-rc1.
Benchmark was run on a 2 socket Core2 machine.

The change in scheduler treatment of sched_yield
could play a part in changing Volanomark behavior.
In CFS, sched_yield is implemented
by dequeueing and requeueing a process . The time a process
has spent running probably reduced the the cpu time due it
by only a bit. The process could get re-queued pretty close
to head of the queue, and may get scheduled again pretty
quickly if there is still a lot of cpu time due.

It may make sense to queue the
yielding process a bit further behind in the queue.
I made a slight change by zeroing out wait_runtime
(i.e. have the process gives
up cpu time due for it to run) for experimentation.
Let's put aside gripes that Volanomark should have used a
better mechanism to coordinate threads instead sched_yield for
a second. Volanomark runs better
and is only 40% (instead of 80%) down from old scheduler
without CFS.

Of course we should not tune for Volanomark and this is
reference data.
What are your view on how CFS's sched_yield should behave?

Regards,
Tim

[-- Attachment #2: patch.sched_yield --]
[-- Type: text/plain, Size: 336 bytes --]

--- linux-2.6.23-rc1/kernel/sched_fair.c.orig 2007-07-27 09:39:11.000000000 -0700
+++ linux-2.6.23-rc1/kernel/sched_fair.c 2007-07-27 09:40:41.000000000 -0700
@@ -841,6 +841,7 @@
* position within the tree:
*/
dequeue_entity(cfs_rq, &p->se, 0, now);
+ p->se.wait_runtime = 0;
enqueue_entity(cfs_rq, &p->se, 0, now);
}