Skip to content

Commit

Permalink
kthread: Don't looking for a task in create_kthread() #2
Browse files Browse the repository at this point in the history
Remove the unnecessary find_task_by_pid_ns(). kthread() can just
use "current" to get the same result.

Signed-off-by: Vitaliy Gusev <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
Vitaliy Gusev authored and rustyrussell committed Apr 9, 2009
1 parent 7b85a88 commit 3217ab9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/kthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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.
Expand Down

0 comments on commit 3217ab9

Please sign in to comment.