Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a44702e8 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Ingo Molnar
Browse files

sched: __sched_setscheduler: Read the RLIMIT_RTPRIO value lockless



__sched_setscheduler() takes lock_task_sighand() to access task->signal.
This is not needed since ea6d290c, ->signal can't go away.

Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100610230944.GA25903@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b6b12294
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -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)