|
@@ -212,6 +212,7 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)
|
|
{
|
|
{
|
|
static unsigned long next = INITIAL_JIFFIES;
|
|
static unsigned long next = INITIAL_JIFFIES;
|
|
struct autogroup *ag;
|
|
struct autogroup *ag;
|
|
|
|
+ unsigned long shares;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
if (nice < MIN_NICE || nice > MAX_NICE)
|
|
if (nice < MIN_NICE || nice > MAX_NICE)
|
|
@@ -230,9 +231,10 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)
|
|
|
|
|
|
next = HZ / 10 + jiffies;
|
|
next = HZ / 10 + jiffies;
|
|
ag = autogroup_task_get(p);
|
|
ag = autogroup_task_get(p);
|
|
|
|
+ shares = scale_load(sched_prio_to_weight[nice + 20]);
|
|
|
|
|
|
down_write(&ag->lock);
|
|
down_write(&ag->lock);
|
|
- err = sched_group_set_shares(ag->tg, sched_prio_to_weight[nice + 20]);
|
|
|
|
|
|
+ err = sched_group_set_shares(ag->tg, shares);
|
|
if (!err)
|
|
if (!err)
|
|
ag->nice = nice;
|
|
ag->nice = nice;
|
|
up_write(&ag->lock);
|
|
up_write(&ag->lock);
|