From: ebiederm@xmission.com (Eric W. Biederman)
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Davide Libenzi <davidel@xmailserver.org>,
Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Roland McGrath <roland@redhat.com>,
Rusty Russell <rusty@rustcorp.com.au>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] make kthread_create() more scalable
Date: Fri, 13 Apr 2007 17:34:46 -0600 [thread overview]
Message-ID: <m18xcvonl5.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070413130201.GA170@tv-sign.ru> (Oleg Nesterov's message of "Fri, 13 Apr 2007 17:02:01 +0400")
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
prev parent reply other threads:[~2007-04-13 23:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-13 13:02 [PATCH 2/3] make kthread_create() more scalable Oleg Nesterov
2007-04-13 21:31 ` Andrew Morton
2007-04-13 21:51 ` Eric W. Biederman
2007-04-13 22:08 ` Andrew Morton
2007-04-13 23:06 ` Eric W. Biederman
2007-04-13 23:34 ` Eric W. Biederman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m18xcvonl5.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=rjw@sisk.pl \
--cc=roland@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.