Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5014156imu; Sun, 25 Nov 2018 15:01:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/VlOQR5q6lZN5wWik0Wak56ePoR9H/zlmthzrM0VZcYCeMcUiaFu9LMxMV+axRqV0GtR+ed X-Received: by 2002:a65:64c8:: with SMTP id t8mr22106489pgv.31.1543186860888; Sun, 25 Nov 2018 15:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543186860; cv=none; d=google.com; s=arc-20160816; b=gZmJfKcvIyw8FruH3mAr7pMQhYzt6VxzRP1FZCVpBOU0Ez9maOKZhdc+GItIuOdRFz 5spWnLvD7JG+aOQX4/oG1x2ebTfyyF3TOO5TtDhlAwOKfrgshfmR6zKUoKRuK4Uwp4Aa dKM8yx15dqHd17Xq/ZRroPunL0mB1lZhq782kpSG3Bg8/hIIEEfesx9P9jxYOPOD9IZy VQezdjltVCbKtKr33KvHeI5xnL5CStrLwbQW0nWl0V4hSKFmBtS7vqRbA5BOuFQeO1ga A47/mBsf7yom1FxdVUcXgpP4Cprn1YjU+y9vHaox45wMrDtV1v5Fe+v9FKZ7sllwqPZi 3H2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DqgPsqIKbb3KTaNAYOrEyIJWhV8TNx+xHDjAjInl/v8=; b=aMrs0z7PXc9CGbpsOXBod+EG1r7hqWYaHIs8Y325f7Zmon1wL0MS+EGrlaOsGEgMr4 EWLIcg9p0W55gCrvK8XxPUbn0mc9LZMmBtuWk7f3wplp1uALUpKht57XjylhE4EHj0tu yEri5bvO8Crpds/UnxKM1W/ILxuBZej1Un0kxgA0jcWJrAKEk5v7x1r3zNs5ybf48Q0B sVCJiAu9JyE49wfb/OgiFimCyzF9TaeVEOjJxcl75hsW6vDVON9KnVyiwpeQCNa/xoaN SOkKVPOCtTblDjluNAn8Ug/zHMoLDV+XL3hi1oYtdJijFGh9oLsJP+z1Cu9FnPjzbFqG nYlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i127-v6si68455783pfc.148.2018.11.25.15.00.45; Sun, 25 Nov 2018 15:01:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726147AbeKZJwW (ORCPT + 99 others); Mon, 26 Nov 2018 04:52:22 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:51542 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbeKZJwW (ORCPT ); Mon, 26 Nov 2018 04:52:22 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 327D080702; Mon, 26 Nov 2018 00:00:05 +0100 (CET) Date: Mon, 26 Nov 2018 00:00:07 +0100 From: Pavel Machek 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 , Dominik Brodowski , Pavel Tatashin , Josh Poimboeuf , Ard Biesheuvel , Michal Hocko , "MatthewWilcox@ip-172-31-15-78" Subject: Re: [PATCH] Add /proc/pid_generation 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" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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--