lkml.org 
[lkml]   [2007]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/3] make kthread_create() more scalable
Date
Oleg Nesterov <oleg@tv-sign.ru> writes:

> If kernel_thread(kthread) succeeds, kthread() can not fail on its path to
> complete(&create->started) + schedule(). After that it can't be woken because
> nobody can see the new task yet. This means:
>
> - we don't need tasklist_lock for find_task_by_pid().

Well we do need rcu_read_lock();
But if we are going to wait until the thread has run we can just pass
back current.

> - create_kthread() doesn't need to wait for create->started. Instead,
> kthread_create() first waits for create->created to get the result of
> kernel_thread(), then waits for create->started to synchronize with
> kthread().

We can do even better. We only need a single completion.
If it was an error create_create can complete it.
Otherwise kthread() can complete it.

Patch in a bit as soon as I finish testing...


Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-14 01:39    [W:0.754 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site