From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH] Add /proc/pid_generation Date: Mon, 26 Nov 2018 00:00:07 +0100 Message-ID: <20181125230007.GC30242@amd> References: <20181121201452.77173-1-dancol@google.com> <20181122111930.GA7164@ip-172-31-15-78> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LwW0XdcUbUexiWVK" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: David Laight Cc: 'Kevin Easton' , Daniel Colascione , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "timmurray@google.com" , "primiano@google.com" , "joelaf@google.com" , Jonathan Corbet , Andrew Morton , Mike Rapoport , Roman Gushchin , Vlastimil Babka , "Dennis Zhou (Facebook)" , Prashant Dhamdhere , "Eric W. Biederman" , "Steven Rostedt (VMware)" , Thomas Gleixner , Ingo Molnar List-Id: linux-api@vger.kernel.org --LwW0XdcUbUexiWVK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2018-11-23 11:14:17, David Laight wrote: > From: Kevin Easton > > Sent: 22 November 2018 11:20 > >=20 > > On Wed, Nov 21, 2018 at 12:14:44PM -0800, Daniel Colascione wrote: > > > This change adds a per-pid-namespace 64-bit generation number, > > > incremented on PID rollover, and exposes it via a new proc file > > > /proc/pid_generation. By examining this file before and after /proc > > > enumeration, user code can detect the potential reuse of a PID and > > > restart the task enumeration process, repeating until it gets a > > > coherent snapshot. > >=20 > > I see downthread this patch has been withdrawn, but nonetheless I'm > > still curious - does this actually solve the problem? > >=20 > > It seems to me that a PID could be reused within a scan even if the > > generation number remains the same at the beginning and end of a scan: >=20 > Why not allocate a 48bit generation number to each 16bit pid? > Then you have a 64bit 'extended-pid' that can be assumed to never be reus= ed. > Provided enough interfaces are enhanced to support 'extended-pid' values > you'll never get reused values. For the record, I really like this proposal. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --LwW0XdcUbUexiWVK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlv7KXcACgkQMOfwapXb+vK6RACgmLicuJiRUJEhrPkeYFDTX9Xl KvgAn3/bVsytzLaQKjZ0CMUlekDSLmbP =Xat+ -----END PGP SIGNATURE----- --LwW0XdcUbUexiWVK--