From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH] Add /proc/pid_generation Date: Wed, 21 Nov 2018 12:31:50 -0800 Message-ID: <20181121203150.GK3065@bombadil.infradead.org> References: <20181121201452.77173-1-dancol@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20181121201452.77173-1-dancol@google.com> Sender: linux-kernel-owner@vger.kernel.org To: Daniel Colascione Cc: 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 List-Id: linux-api@vger.kernel.org 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. > > PID rollover ought to be rare, so in practice, scan repetitions will > be rare. Then why does it need to be 64-bit?