lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Apr 2007 15:08:41 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	ebiederm@...ssion.com (Eric W. Biederman)
Cc:	Oleg Nesterov <oleg@...sign.ru>,
	Davide Libenzi <davidel@...ilserver.org>,
	Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Roland McGrath <roland@...hat.com>,
	Rusty Russell <rusty@...tcorp.com.au>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] make kthread_create() more scalable

On Fri, 13 Apr 2007 15:51:29 -0600
ebiederm@...ssion.com (Eric W. Biederman) wrote:

> Andrew Morton <akpm@...ux-foundation.org> writes:
> 
> > On Fri, 13 Apr 2007 17:02:01 +0400
> > Oleg Nesterov <oleg@...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.
> 

OK, I fixed that up.

The next patch (make-kthread_stop-scalable) removes the find_task_by_pid()
anyway.

Our kthread creation performance will be pretty poor anyway, due to the
need to do two (or more?) context switches.  If we ever need
super-low-latency kernel thread creation (eg, on-demand threads for AIO)
then that code would need to go direct to kernel_thread(), I guess.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ