Skip to content

Commit

Permalink
sched: Drop all load weight manipulation for RT tasks
Browse files Browse the repository at this point in the history
Load weights are for the CFS, they do not belong in the RT task. This makes all
RT scheduling classes leave the CFS weights alone.

This fixes a real bug as well: I noticed the following phonomena: a process
elevated to SCHED_RR forks with SCHED_RESET_ON_FORK set, and the child is
indeed SCHED_OTHER, and the niceval is indeed reset to 0. However the weight
inserted by set_load_weight() remains at 0, giving the task insignificat
priority.

With this fix, the weight is reset to what the task had before being elevated
to SCHED_RR/SCHED_FIFO.

Cc: Lennart Poettering <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Linus Walleij authored and Ingo Molnar committed Oct 18, 2010
1 parent 34f971f commit 17bdcf9
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,12 +1855,6 @@ static void dec_nr_running(struct rq *rq)

static void set_load_weight(struct task_struct *p)
{
if (task_has_rt_policy(p)) {
p->se.load.weight = 0;
p->se.load.inv_weight = WMULT_CONST;
return;
}

/*
* SCHED_IDLE tasks get minimal weight:
*/
Expand Down

0 comments on commit 17bdcf9

Please sign in to comment.