mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>,
	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 15:51:29 -0600	[thread overview]
Message-ID: <m1lkgwndsu.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070413143104.99a1eeb9.akpm@linux-foundation.org> (Andrew Morton's message of "Fri, 13 Apr 2007 14:31:04 -0700")

Andrew Morton <akpm@linux-foundation.org> writes:

> On Fri, 13 Apr 2007 17:02:01 +0400
> Oleg Nesterov <oleg@tv-sign.ru> wrote:
>
>> 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().
>> 
>> 	- 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().
>
> Why don't we need tasklist_lock for find_task_by_pid()?  I'd have though that
> we'd at least need rcu_read_lock(), and I'm not sure that the implicit
> understanding of pid-management internals here is a great idea.

We need rcu_read_lock().  Or else something could permute the pid hash table
and get us into trouble.

Eric






  reply	other threads:[~2007-04-13 21:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13 13:02 Oleg Nesterov
2007-04-13 21:31 ` Andrew Morton
2007-04-13 21:51   ` Eric W. Biederman [this message]
2007-04-13 22:08     ` Andrew Morton
2007-04-13 23:06       ` Eric W. Biederman
2007-04-13 23:34 ` Eric W. Biederman

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=m1lkgwndsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®