[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df7f7e17a730405ea182ec778eec22e1@AcuMS.aculab.com>
Date: Wed, 19 Aug 2020 15:41:48 +0000
From: David Laight <David.Laight@...LAB.COM>
To: "'Eric W. Biederman'" <ebiederm@...ssion.com>,
Christian Brauner <christian.brauner@...ntu.com>
CC: Matthew Wilcox <willy@...radead.org>,
"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: Eric W. Biederman
> Sent: 19 August 2020 16:01
...
> >> Further the design decisions of pids keeps us densly using pids. So I
> >> expect it will be a while before we even come close to using 30 bits of
> >> pid space.
> >
> > Also because it's simply annoying to have to type really large pid
> > numbers on the shell. Yes yes, that's a very privileged
> > developer-centric complaint but it matters when you have to do a quick
> > kill -9. Chromebook users obviously won't care about how large their
> > pids are for sure.
>
> Actually that is one of the reasons (possibly the primary reason) that
> we have chosen to keep pid numbers dense.
It also helps keep the ps output under 80 cols.
> There may be fewer users of unix shells then their used to be, and we
> may now have pidfds. But until people stop using pids in shells it is a
> very valid reason to keep them densly packed.
ISTM that the upper limit should be increased automatically
when the number of allocated pids gets large enough that they
are likely to run out (or get reused very quickly).
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??
I made the NetBSD pid allocator/lookup use pid_array[pid & mask]
then check the high bits matched (incremented on allocate).
With a FIFO free list through the unused entries.
Fairly easy to double the size and 'unzip' when getting full.
And then allocate extra high bits to keep plenty of free
values in circulation.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists