aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-07 14:35:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-07 14:35:55 -0500
commit68f5503bdc8fc309b62a4f555a048ee50d0495a5 (patch)
treece0210db3a8844481aedbbc9aeafce27be3e659c
parentbf7f1c7e2fdfe8b5050e8b3eebf111bf2ed1e8c9 (diff)
parent83929cce95251cc77e5659bf493bd424ae0e7a67 (diff)
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fix from Ingo Molnar: "An autogroup nice level adjustment bug fix" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/autogroup: Fix 64-bit kernel nice level adjustment
-rw-r--r--kernel/sched/auto_group.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched/auto_group.c b/kernel/sched/auto_group.c
index f1c8fd566246..da39489d2d80 100644
--- a/kernel/sched/auto_group.c
+++ b/kernel/sched/auto_group.c
@@ -212,6 +212,7 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)
212{ 212{
213 static unsigned long next = INITIAL_JIFFIES; 213 static unsigned long next = INITIAL_JIFFIES;
214 struct autogroup *ag; 214 struct autogroup *ag;
215 unsigned long shares;
215 int err; 216 int err;
216 217
217 if (nice < MIN_NICE || nice > MAX_NICE) 218 if (nice < MIN_NICE || nice > MAX_NICE)
@@ -230,9 +231,10 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)
230 231
231 next = HZ / 10 + jiffies; 232 next = HZ / 10 + jiffies;
232 ag = autogroup_task_get(p); 233 ag = autogroup_task_get(p);
234 shares = scale_load(sched_prio_to_weight[nice + 20]);
233 235
234 down_write(&ag->lock); 236 down_write(&ag->lock);
235 err = sched_group_set_shares(ag->tg, sched_prio_to_weight[nice + 20]); 237 err = sched_group_set_shares(ag->tg, shares);
236 if (!err) 238 if (!err)
237 ag->nice = nice; 239 ag->nice = nice;
238 up_write(&ag->lock); 240 up_write(&ag->lock);