BFS vs. mainline scheduler benchmarks and measurements
BFS vs. mainline scheduler benchmarks and measurements
Posted Sep 8, 2009 9:44 UTC (Tue) by mingo (subscriber, #31122)In reply to: BFS vs. mainline scheduler benchmarks and measurements by epa
Parent article: BFS vs. mainline scheduler benchmarks and measurements
The thing is, nice levels mostly affect total throughput, but what needs improvement is latency.
That's exactly what the upstream scheduler does. The upstream scheduler considers latency goals in a nice-level normalized way. See the wakeup_gran() function in kernel/sched_fair.c:
static unsigned long
wakeup_gran(struct sched_entity *curr, struct sched_entity *se)
{
unsigned long gran = sysctl_sched_wakeup_granularity;
[...]
if (unlikely(se->load.weight != NICE_0_LOAD))
gran = calc_delta_fair(gran, se);
[...]
}
See the calc_delta_fair() - that is the nice level normalizer. Plus-reniced tasks will get longer latencies - minus-reniced tasks will get shorter wakeup latencies.
If this does not work for you then that's a bug, please report it in that case.
Note that you can tune the basic kernel latency goals/deadlines via two dynamic sysctls: sched_wakeup_granularity_ns and sched_latency_ns. Lower those and you'll get a snappier desktop - at the expense of some throughput.
You can set these in /etc/sysctl.conf to make the settings permanent. (and please report it to us if a new setting improves some workload in a dramatic way - we constantly re-tune the upstream default as well, to make for a snappier desktop.)
(Note that for forced preemption (CPU bound tasks) HZ is a lower limit - but otherwise it's tunable in a finegrained way. So say you want to change from HZ=250 to HZ=1000 if you want to set the latency targets down to 1 millisecond.)
