Peter Williams wrote: > The problem: > > The current scheduler implementation maps 40 nice values and 10 bonus > values into only 40 priority slots on the run queues. This results in > the dynamic priorities of tasks at either end of the nice scale being > squished up. E.g. all tasks with nice in the range -20 to -16 and the > maximum of 10 bonus points will end up with a dynamic priority of > MAX_RT_PRIO and all tasks with nice in the range 15 to 19 and no bonus > points will end up with a dynamic priority of MAX_PRIO - 1. > > Although the fact that niceness is primarily implemented by time slice > size means that this will have little or no adverse effect on the long > term allocation of CPU resources due to niceness, it could adversely > effect latency as it will interfere with preemption. > > The solution: > > Increase the number of priority slots in the run queues to allow a > linear mapping and eliminate the squish. > > The implementation: > > As the only place MAX_PRIO is used outside of sched.c is to initialize > the init task in init_task.h, it is possible to implement the solution > entirely within sched.c by defining a new macro IDLE_PRIO (which is > equal to the sum of MAX_PRIO and MAX_BONUS) and then replacing MAX_PRIO > by IDLE_PRIO where appropriate. > > Signed-off-by: Peter Williams I overlooked the effect of this patch on the TASK_INTERACTIVE() macro function and this has an adverse effect on interactive responsiveness. A modified patch that corrects that oversight is attached. Signed-off-by: Peter Williams sched.c | 38 ++++++++++++++++++-------------------- 1 files changed, 18 insertions(+), 20 deletions(-) -- Peter Williams pwil3058@bigpond.net.au "Learning, n. The kind of ignorance distinguishing the studious." -- Ambrose Bierce