Files
kernel/include/linux
Ingo Molnar f6cf891c4d sched: make the scheduler converge to the ideal latency
de-HZ-ification of the granularity defaults unearthed a pre-existing
property of CFS: while it correctly converges to the granularity goal,
it does not prevent run-time fluctuations in the range of
[-gran ... 0 ... +gran].

With the increase of the granularity due to the removal of HZ
dependencies, this becomes visible in chew-max output (with 5 tasks
running):

 out:  28 . 27. 32 | flu:  0 .  0 | ran:    9 .   13 | per:   37 .   40
 out:  27 . 27. 32 | flu:  0 .  0 | ran:   17 .   13 | per:   44 .   40
 out:  27 . 27. 32 | flu:  0 .  0 | ran:    9 .   13 | per:   36 .   40
 out:  29 . 27. 32 | flu:  2 .  0 | ran:   17 .   13 | per:   46 .   40
 out:  28 . 27. 32 | flu:  0 .  0 | ran:    9 .   13 | per:   37 .   40
 out:  29 . 27. 32 | flu:  0 .  0 | ran:   18 .   13 | per:   47 .   40
 out:  28 . 27. 32 | flu:  0 .  0 | ran:    9 .   13 | per:   37 .   40

average slice is the ideal 13 msecs and the period is picture-perfect 40
msecs. But the 'ran' field fluctuates around 13.33 msecs and there's no
mechanism in CFS to keep that from happening: it's a perfectly valid
solution that CFS finds.

to fix this we add a granularity/preemption rule that knows about
the "target latency", which makes tasks that run longer than the ideal
latency run a bit less. The simplest approach is to simply decrease the
preemption granularity when a task overruns its ideal latency. For this
we have to track how much the task executed since its last preemption.

( this adds a new field to task_struct, but we can eliminate that
  overhead in 2.6.24 by putting all the scheduler timestamps into an
  anonymous union. )

with this change in place, chew-max output is fluctuation-less all
around:

 out:  28 . 27. 39 | flu:  0 .  2 | ran:   13 .   13 | per:   41 .   40
 out:  28 . 27. 39 | flu:  0 .  2 | ran:   13 .   13 | per:   41 .   40
 out:  28 . 27. 39 | flu:  0 .  2 | ran:   13 .   13 | per:   41 .   40
 out:  28 . 27. 39 | flu:  0 .  2 | ran:   13 .   13 | per:   41 .   40
 out:  28 . 27. 39 | flu:  0 .  1 | ran:   13 .   13 | per:   41 .   40
 out:  28 . 27. 39 | flu:  0 .  1 | ran:   13 .   13 | per:   41 .   40

this patch has no impact on any fastpath or on any globally observable
scheduling property. (unless you have sharp enough eyes to see
millisecond-level ruckles in glxgears smoothness :-)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Mike Galbraith <efault@gmx.de>
2007-08-28 12:53:24 +02:00
..
2007-07-12 15:41:24 -07:00
2007-07-26 01:53:39 +02:00
2007-07-19 10:04:52 -07:00
2007-07-31 15:39:44 -07:00
2007-07-19 10:04:43 -07:00
2007-07-20 01:11:59 +02:00
2007-08-23 21:37:45 -07:00
2007-07-19 10:04:45 -07:00
2007-08-11 22:34:48 +02:00
2007-07-31 10:43:05 -05:00
2007-07-10 17:18:59 -07:00
2007-07-16 09:05:46 -07:00
2007-08-12 18:08:19 +02:00
2007-07-17 10:23:04 -07:00
2007-07-09 08:22:54 +01:00
2007-07-09 08:23:17 +01:00
2007-07-11 16:09:00 -07:00
2007-07-19 10:04:54 -07:00
2007-07-12 10:55:56 -07:00
2007-07-17 10:23:06 -07:00
2007-07-16 09:05:52 -07:00
2007-07-16 09:05:52 -07:00
2007-07-18 09:15:20 -04:00
2007-07-18 09:15:20 -04:00
2007-07-17 10:23:13 -07:00
2007-07-16 09:05:45 -07:00
2007-07-18 18:29:37 -04:00
2007-07-16 09:05:41 -07:00
2007-06-18 09:48:41 -07:00
2007-07-17 10:22:59 -07:00
2007-07-10 00:35:17 -04:00
2007-07-09 18:51:58 +02:00
2007-07-19 10:04:41 -07:00
2007-07-29 17:09:29 -07:00
2007-07-31 15:39:41 -07:00
2007-07-16 09:05:34 -07:00
2007-07-10 22:15:03 -07:00
2007-07-14 18:55:06 -07:00
2007-07-16 09:05:47 -07:00
2007-08-11 15:58:13 -07:00
2007-07-16 09:05:50 -07:00
2007-07-16 09:05:47 -07:00
2007-07-31 15:39:41 -07:00
2007-08-26 18:35:34 -07:00
2007-07-18 08:47:40 -07:00
2007-07-30 14:25:12 -07:00
2007-07-10 22:15:26 -07:00
2007-07-17 10:23:03 -07:00
2007-07-17 10:23:13 -07:00
2007-07-19 10:04:49 -07:00
2007-07-24 12:24:59 -07:00
2007-07-16 09:05:34 -07:00
2007-07-18 08:47:45 -07:00
2007-07-16 09:05:42 -07:00
2007-07-19 10:04:45 -07:00
2007-07-16 09:05:51 -07:00
2007-08-07 15:13:17 -04:00
2007-07-20 13:41:56 +10:00
2007-07-20 13:10:22 +10:00
2007-07-26 11:35:21 -07:00
2007-07-26 11:35:21 -07:00
2007-07-16 09:05:50 -07:00
2007-07-16 09:05:46 -07:00
2007-07-17 10:23:03 -07:00
2007-07-18 08:47:40 -07:00
2007-07-21 18:37:10 -07:00
2007-07-16 09:05:50 -07:00
2007-07-22 11:03:37 -07:00
2007-07-20 12:33:44 -07:00
2007-07-20 08:24:50 -07:00
2007-07-16 09:05:45 -07:00
2007-07-16 09:05:46 -07:00
2007-07-19 10:04:49 -07:00
2007-07-16 09:05:40 -07:00
2007-07-18 08:47:40 -07:00
2007-07-17 10:22:59 -07:00
2007-07-31 15:39:39 -07:00
2007-07-20 11:23:02 -07:00
2007-08-11 15:47:41 -07:00
2007-07-18 15:57:15 -07:00
2007-07-30 13:27:44 -07:00
2007-07-17 10:22:59 -07:00
2007-07-09 18:52:01 +02:00