Commit 3217ab97 authored by Vitaliy Gusev's avatar Vitaliy Gusev Committed by Rusty Russell

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: default avatarVitaliy Gusev <vgusev@openvz.org>
Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 7b85a88c
...@@ -76,6 +76,7 @@ static int kthread(void *_create) ...@@ -76,6 +76,7 @@ static int kthread(void *_create)
/* OK, tell user we're spawned, wait for stop or wakeup */ /* OK, tell user we're spawned, wait for stop or wakeup */
__set_current_state(TASK_UNINTERRUPTIBLE); __set_current_state(TASK_UNINTERRUPTIBLE);
create->result = current;
complete(&create->started); complete(&create->started);
schedule(); schedule();
...@@ -101,9 +102,6 @@ static void create_kthread(struct kthread_create_info *create) ...@@ -101,9 +102,6 @@ static void create_kthread(struct kthread_create_info *create)
} else { } else {
struct sched_param param = { .sched_priority = 0 }; struct sched_param param = { .sched_priority = 0 };
wait_for_completion(&create->started); wait_for_completion(&create->started);
read_lock(&tasklist_lock);
create->result = find_task_by_pid_ns(pid, &init_pid_ns);
read_unlock(&tasklist_lock);
/* /*
* root may have changed our (kthreadd's) priority or CPU mask. * root may have changed our (kthreadd's) priority or CPU mask.
* The kernel thread should not inherit these properties. * The kernel thread should not inherit these properties.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment