Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288759
b: refs/heads/master
c: 2e5b5b3
h: refs/heads/master
i:
  288757: 8ea31ba
  288755: 3738c89
  288751: b9a20c8
v: v3
  • Loading branch information
Hiroshi Shimamoto authored and Ingo Molnar committed Mar 2, 2012
1 parent c05c0a0 commit 96e0235
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 367456c756a6b84f493ca9cc5b17b1f5d38ef466
refs/heads/master: 2e5b5b3a1b7768c89fbfeca18e75f8ee377e924c
3 changes: 1 addition & 2 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,8 +1310,7 @@ sched_autogroup_write(struct file *file, const char __user *buf,
if (!p)
return -ESRCH;

err = nice;
err = proc_sched_autogroup_set_nice(p, &err);
err = proc_sched_autogroup_set_nice(p, nice);
if (err)
count = err;

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ extern void sched_autogroup_fork(struct signal_struct *sig);
extern void sched_autogroup_exit(struct signal_struct *sig);
#ifdef CONFIG_PROC_FS
extern void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m);
extern int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice);
extern int proc_sched_autogroup_set_nice(struct task_struct *p, int nice);
#endif
#else
static inline void sched_autogroup_create_attach(struct task_struct *p) { }
Expand Down
12 changes: 6 additions & 6 deletions trunk/kernel/sched/auto_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,20 @@ __setup("noautogroup", setup_autogroup);

#ifdef CONFIG_PROC_FS

int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice)
int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)
{
static unsigned long next = INITIAL_JIFFIES;
struct autogroup *ag;
int err;

if (*nice < -20 || *nice > 19)
if (nice < -20 || nice > 19)
return -EINVAL;

err = security_task_setnice(current, *nice);
err = security_task_setnice(current, nice);
if (err)
return err;

if (*nice < 0 && !can_nice(current, *nice))
if (nice < 0 && !can_nice(current, nice))
return -EPERM;

/* this is a heavy operation taking global locks.. */
Expand All @@ -219,9 +219,9 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice)
ag = autogroup_task_get(p);

down_write(&ag->lock);
err = sched_group_set_shares(ag->tg, prio_to_weight[*nice + 20]);
err = sched_group_set_shares(ag->tg, prio_to_weight[nice + 20]);
if (!err)
ag->nice = *nice;
ag->nice = nice;
up_write(&ag->lock);

autogroup_kref_put(ag);
Expand Down

0 comments on commit 96e0235

Please sign in to comment.