Skip to content

Commit

Permalink
sched: __sched_setscheduler: Read the RLIMIT_RTPRIO value lockless
Browse files Browse the repository at this point in the history
__sched_setscheduler() takes lock_task_sighand() to access task->signal.
This is not needed since ea6d290, ->signal can't go away.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100610230944.GA25903@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Jun 18, 2010
1 parent b6b1229 commit a44702e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4600,12 +4600,8 @@ static int __sched_setscheduler(struct task_struct *p, int policy,
*/
if (user && !capable(CAP_SYS_NICE)) {
if (rt_policy(policy)) {
unsigned long rlim_rtprio;

if (!lock_task_sighand(p, &flags))
return -ESRCH;
rlim_rtprio = task_rlimit(p, RLIMIT_RTPRIO);
unlock_task_sighand(p, &flags);
unsigned long rlim_rtprio =
task_rlimit(p, RLIMIT_RTPRIO);

/* can't set/change the rt policy */
if (policy != p->policy && !rlim_rtprio)
Expand Down

0 comments on commit a44702e

Please sign in to comment.