diff options
-rw-r--r-- | kernel/sched.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index c62acf45d3b9..d036048b59a4 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1778,17 +1778,20 @@ static void dec_nr_running(struct rq *rq) | |||
1778 | 1778 | ||
1779 | static void set_load_weight(struct task_struct *p) | 1779 | static void set_load_weight(struct task_struct *p) |
1780 | { | 1780 | { |
1781 | int prio = p->static_prio - MAX_RT_PRIO; | ||
1782 | struct load_weight *load = &p->se.load; | ||
1783 | |||
1781 | /* | 1784 | /* |
1782 | * SCHED_IDLE tasks get minimal weight: | 1785 | * SCHED_IDLE tasks get minimal weight: |
1783 | */ | 1786 | */ |
1784 | if (p->policy == SCHED_IDLE) { | 1787 | if (p->policy == SCHED_IDLE) { |
1785 | p->se.load.weight = WEIGHT_IDLEPRIO; | 1788 | load->weight = WEIGHT_IDLEPRIO; |
1786 | p->se.load.inv_weight = WMULT_IDLEPRIO; | 1789 | load->inv_weight = WMULT_IDLEPRIO; |
1787 | return; | 1790 | return; |
1788 | } | 1791 | } |
1789 | 1792 | ||
1790 | p->se.load.weight = prio_to_weight[p->static_prio - MAX_RT_PRIO]; | 1793 | load->weight = prio_to_weight[prio]; |
1791 | p->se.load.inv_weight = prio_to_wmult[p->static_prio - MAX_RT_PRIO]; | 1794 | load->inv_weight = prio_to_wmult[prio]; |
1792 | } | 1795 | } |
1793 | 1796 | ||
1794 | static void enqueue_task(struct rq *rq, struct task_struct *p, int flags) | 1797 | static void enqueue_task(struct rq *rq, struct task_struct *p, int flags) |