summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaliy Gusev <vgusev@openvz.org>2009-04-09 17:50:35 +0200
committerRusty Russell <rusty@rustcorp.com.au>2009-04-09 02:20:36 +0200
commit3217ab97f14c5c8f9f975ed8c40c351164b0b10e (patch)
tree3bb4b32e9a1e5b96915fbce57184d55f74e43fe9
parentMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/... (diff)
downloadlinux-3217ab97f14c5c8f9f975ed8c40c351164b0b10e.tar.xz
linux-3217ab97f14c5c8f9f975ed8c40c351164b0b10e.zip
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>
-rw-r--r--kernel/kthread.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 84bbadd4d021..c013bf000ce6 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -76,6 +76,7 @@ static int kthread(void *_create)
/* OK, tell user we're spawned, wait for stop or wakeup */
__set_current_state(TASK_UNINTERRUPTIBLE);
+ create->result = current;
complete(&create->started);
schedule();
@@ -101,9 +102,6 @@ static void create_kthread(struct kthread_create_info *create)
} else {
struct sched_param param = { .sched_priority = 0 };
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.
* The kernel thread should not inherit these properties.