diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-09 23:25:34 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-09 23:25:34 -0700 |
| commit | 47ad0fced4c434ac4f37bc9f40e840b32693e55d (patch) | |
| tree | 687c6116315c2189eb70c6877e2ecf75c13f0807 /drivers/input/joydev.c | |
| parent | a5f39fd8b3fc065350d9bd51a44c19a7b930c047 (diff) | |
[PATCH] sched: SMT niceness handling
From: Con Kolivas <kernel@kolivas.org>
This patch provides full per-package priority support for SMT processors
(aka pentium4 hyperthreading) when combined with CONFIG_SCHED_SMT.
It maintains cpu percentage distribution within each physical cpu package
by limiting the time a lower priority task can run on a sibling cpu
concurrently with a higher priority task.
It introduces a new flag into the scheduler domain
unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */
This is empirically set to 15% for pentium4 at the moment and can be
modified to support different values dynamically as newer processors come
out with improved SMT performance. It should not matter how many siblings
there are.
How it works is it compares tasks running on sibling cpus and when a lower
static priority task is running it will delay it till
high_priority_timeslice * (100 - per_cpu_gain) / 100 <= low_prio_timeslice
eg. a nice 19 task timeslice is 10ms and nice 0 timeslice is 102ms On
vanilla the nice 0 task runs on one logical cpu while the nice 19 task runs
unabated on the other logical cpu. With smtnice the nice 0 runs on one
logical cpu for 102ms and the nice 19 sleeps till the nice 0 task has 12ms
remaining and then will schedule.
Real time tasks and kernel threads are not altered by this code, and kernel
threads do not delay lower priority user tasks.
with lots of thanks to Zwane Mwaikambo and Nick Piggin for help with the
coding of this version.
If this is merged, it is probably best to delay pushing this upstream in
mainline till sched_domains gets tested for at least one major release.
Diffstat (limited to 'drivers/input/joydev.c')
0 files changed, 0 insertions, 0 deletions
