Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234565
b: refs/heads/master
c: c02aa73
h: refs/heads/master
i:
  234563: 9062b8c
v: v3
  • Loading branch information
Darren Hart authored and Ingo Molnar committed Mar 4, 2011
1 parent a6a2d20 commit 2ae7de7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: a2f5c9ab79f78e8b91ac993e0543d65b661dd19b
refs/heads/master: c02aa73b1d18e43cfd79c2f193b225e84ca497c8
11 changes: 7 additions & 4 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4981,12 +4981,15 @@ static int __sched_setscheduler(struct task_struct *p, int policy,
param->sched_priority > rlim_rtprio)
return -EPERM;
}

/*
* Like positive nice levels, dont allow tasks to
* move out of SCHED_IDLE either:
* Treat SCHED_IDLE as nice 20. Only allow a switch to
* SCHED_NORMAL if the RLIMIT_NICE would normally permit it.
*/
if (p->policy == SCHED_IDLE && policy != SCHED_IDLE)
return -EPERM;
if (p->policy == SCHED_IDLE && policy != SCHED_IDLE) {
if (!can_nice(p, TASK_NICE(p)))
return -EPERM;
}

/* can't change other user's priorities */
if (!check_same_owner(p))
Expand Down

0 comments on commit 2ae7de7

Please sign in to comment.