[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ee30fecfbd534c19a6bfd11d2c4b8263@AcuMS.aculab.com>
Date: Wed, 19 Aug 2020 15:55:47 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Matthew Wilcox' <willy@...radead.org>
CC: "'Eric W. Biederman'" <ebiederm@...ssion.com>,
Christian Brauner <christian.brauner@...ntu.com>,
"peterz@...radead.org" <peterz@...radead.org>,
Christoph Hewllig <hch@...radead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
"Yoshinori Sato" <ysato@...rs.sourceforge.jp>,
Tony Luck <tony.luck@...el.com>,
"Fenghua Yu" <fenghua.yu@...el.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
"Ley Foon Tan" <ley.foon.tan@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"x86@...nel.org" <x86@...nel.org>, "Arnd Bergmann" <arnd@...db.de>,
Steven Rostedt <rostedt@...dmis.org>,
"Stafford Horne" <shorne@...il.com>,
Kars de Jong <jongk@...ux-m68k.org>,
Kees Cook <keescook@...omium.org>,
Greentime Hu <green.hu@...il.com>,
"Mauro Carvalho Chehab" <mchehab+huawei@...nel.org>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
"Tom Zanussi" <zanussi@...nel.org>,
Xiao Yang <yangx.jy@...fujitsu.com>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"uclinux-h8-devel@...ts.sourceforge.jp"
<uclinux-h8-devel@...ts.sourceforge.jp>,
"linux-ia64@...r.kernel.org" <linux-ia64@...r.kernel.org>,
"linux-m68k@...ts.linux-m68k.org" <linux-m68k@...ts.linux-m68k.org>,
"sparclinux@...r.kernel.org" <sparclinux@...r.kernel.org>,
"kgdb-bugreport@...ts.sourceforge.net"
<kgdb-bugreport@...ts.sourceforge.net>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>
Subject: RE: [PATCH 00/11] Introduce kernel_clone(), kill _do_fork()
From: Matthew Wilcox
> Sent: 19 August 2020 16:45
>
> On Wed, Aug 19, 2020 at 03:41:48PM +0000, David Laight wrote:
> > Does linux have an O(1) (or do I mean o(1)) pid allocator?
> > Or does it have to do a linear scan to find a gap??
>
> O(log(n)). It uses the IDR allocator, so 'n' in this case is the
> number of PIDs currently allocated, and it's log_64 rather than log_2
> (which makes no difference to O() but does make a bit of a difference
> to performance)
Still worse that O(1) - when that is just replacing a variable
with a value read out of an array.
Made pid lookup a trivial O(1) as well.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists