summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner2006-06-27 11:55:00 +0200
committerLinus Torvalds2006-06-28 02:32:47 +0200
commite74c69f46d93d29eea0ad8647863d1c6488f0f55 (patch)
tree5537d5a60eec3985de11cad4476ed95025051721
parent[PATCH] fix rt-mutex defaults and dependencies (diff)
downloadkernel-qcow2-linux-e74c69f46d93d29eea0ad8647863d1c6488f0f55.tar.gz
kernel-qcow2-linux-e74c69f46d93d29eea0ad8647863d1c6488f0f55.tar.xz
kernel-qcow2-linux-e74c69f46d93d29eea0ad8647863d1c6488f0f55.zip
[PATCH] Drop tasklist lock in do_sched_setscheduler
There is no need to hold tasklist_lock across the setscheduler call, when we pin the task structure with get_task_struct(). Interrupts are disabled in setscheduler anyway and the permission checks do not need interrupts disabled. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--kernel/sched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 08431f07a999..7a30addfd235 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4091,8 +4091,10 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
read_unlock_irq(&tasklist_lock);
return -ESRCH;
}
- retval = sched_setscheduler(p, policy, &lparam);
+ get_task_struct(p);
read_unlock_irq(&tasklist_lock);
+ retval = sched_setscheduler(p, policy, &lparam);
+ put_task_struct(p);
return retval;
}