public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] kernel/pid.c pid allocation wierdness
@ 2007-03-14  7:30 Pavel Emelianov
  2007-03-14 14:12 ` Eric W. Biederman
  2007-03-14 14:43 ` William Lee Irwin III
  0 siblings, 2 replies; 14+ messages in thread
From: Pavel Emelianov @ 2007-03-14  7:30 UTC (permalink / raw)
  To: Eric W. Biederman, Sukadev Bhattiprolu, Serge Hallyn,
	Linux Kernel Mailing List

Hi.

I'm looking at how alloc_pid() works and can't understand
one (simple/stupid) thing.

It first kmem_cache_alloc()-s a strct pid, then calls
alloc_pidmap() and at the end it taks a global pidmap_lock()
to add new pid to hash.

The question is - why does alloc_pidmap() use at least
two atomic ops and potentially loop to find a zero bit
in pidmap? Why not call alloc_pidmap() under pidmap_lock
and find zero pid in pidmap w/o any loops and atomics?

The same is for free_pid(). Do I miss something?

Thank,
Pavel

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-03-16 21:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-14  7:30 [RFC] kernel/pid.c pid allocation wierdness Pavel Emelianov
2007-03-14 14:12 ` Eric W. Biederman
2007-03-14 15:03   ` William Lee Irwin III
2007-03-14 16:54     ` Eric W. Biederman
2007-03-15 20:26       ` William Lee Irwin III
2007-03-16 13:04         ` Eric W. Biederman
2007-03-16 19:46           ` William Lee Irwin III
2007-03-16 21:18             ` Eric W. Biederman
2007-03-14 15:33   ` Oleg Nesterov
2007-03-16 10:57     ` Pavel Emelianov
2007-03-16 11:37       ` Eric Dumazet
2007-03-16 11:58         ` Pavel Emelianov
2007-03-16 11:40       ` Dmitry Adamushko
2007-03-14 14:43 ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox