aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kthread.c
diff options
context:
space:
mode:
authorVitaliy Gusev <vgusev@openvz.org>2009-04-09 11:50:35 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-04-08 20:20:36 -0400
commit3217ab97f14c5c8f9f975ed8c40c351164b0b10e (patch)
tree3bb4b32e9a1e5b96915fbce57184d55f74e43fe9 /kernel/kthread.c
parent7b85a88ca7760d6d5f34bdaa793c71d921a3e853 (diff)
kthread: Don't looking for a task in create_kthread() #2
Remove the unnecessary find_task_by_pid_ns(). kthread() can just use "current" to get the same result. Signed-off-by: Vitaliy Gusev <vgusev@openvz.org> Acked-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r--kernel/kthread.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 84bbadd4d02..c013bf000ce 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -76,6 +76,7 @@ static int kthread(void *_create)
76 76
77 /* OK, tell user we're spawned, wait for stop or wakeup */ 77 /* OK, tell user we're spawned, wait for stop or wakeup */
78 __set_current_state(TASK_UNINTERRUPTIBLE); 78 __set_current_state(TASK_UNINTERRUPTIBLE);
79 create->result = current;
79 complete(&create->started); 80 complete(&create->started);
80 schedule(); 81 schedule();
81 82
@@ -101,9 +102,6 @@ static void create_kthread(struct kthread_create_info *create)
101 } else { 102 } else {
102 struct sched_param param = { .sched_priority = 0 }; 103 struct sched_param param = { .sched_priority = 0 };
103 wait_for_completion(&create->started); 104 wait_for_completion(&create->started);
104 read_lock(&tasklist_lock);
105 create->result = find_task_by_pid_ns(pid, &init_pid_ns);
106 read_unlock(&tasklist_lock);
107 /* 105 /*
108 * root may have changed our (kthreadd's) priority or CPU mask. 106 * root may have changed our (kthreadd's) priority or CPU mask.
109 * The kernel thread should not inherit these properties. 107 * The kernel thread should not inherit these properties.