Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp403690imu; Wed, 21 Nov 2018 22:37:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/WlIDAnPRuk3NsXJn07z/jCey6GyY4gW0SvDH5BVqyseYJMnkAzioLPwtNlYq3Z0aQqpn+J X-Received: by 2002:a17:902:4d46:: with SMTP id o6mr9590121plh.302.1542868673738; Wed, 21 Nov 2018 22:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542868673; cv=none; d=google.com; s=arc-20160816; b=DBhBg1NJWm9aJUns66KfHx7Rx2bnFcooiWr9P8GA/JZS4z7XAUY6uGEj2Q0/BECTSx fus+vH7iH6igRnWLFvssYWhY+907JO5QzGifQwCWu4mooDqXM8SXpNbInEfv2ySqdfkA Xnh8N8WGUm+DA5nhVR8DF46eXpBFh5b7K24xW18Bw2Z6cS/4AmoFss1N/qqa1yH8Q0IF 52AX1FHfMOXH1ZGSC586xIT4r6bd4EkbkR7nO0ua0PpZDLNR8Vrk4aAMosxZ12qGrmbL jMUSJQ2hSldyivvFefrJVRdq7fGXz4s4AZt4doibfOSkxw+aIA+VWyaSS9n/mFzBqyOw QjTw== 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:dkim-signature; bh=045HICJJn4lFtl8ezh0YLS2Wnlr4WooCucz847EazK4=; b=jIW+RDFygjr5eckMsXM2BXq4FFHgpsp1P9LNtIMuWeHRj4aQzkJwMDEcIbB5LNy8i1 JWRSBrNC9mMsp8xJcw0GXAZzAGy96A8IpHDXqoIh2Jkxm4nggzVMFPMg18NnYUWnYIU/ eA0p/zx8V0maIJFay03GL6oRa2JNOfkVM5L9/9JBGOmgFcSDH9gZzSnSMHqk8oKn6tRw dP1Fxz+ue1LCrvmUEQj6WDEkw4yvKTs60W0dB6ZLTRdWYkxwSkG1af8N9NB46ARCK4il IhjpPNetfNcoGKo82WBJSU6ExfCX7Cwbe+EqrirnaDUMnW1UHIzL9j7qAnkTsEVvwVNU 6KrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iHvfIKmN; 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 t3si30442778pgl.108.2018.11.21.22.37.38; Wed, 21 Nov 2018 22:37:53 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iHvfIKmN; 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 S2389625AbeKVHHs (ORCPT + 99 others); Thu, 22 Nov 2018 02:07:48 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:55448 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726429AbeKVHHs (ORCPT ); Thu, 22 Nov 2018 02:07:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=045HICJJn4lFtl8ezh0YLS2Wnlr4WooCucz847EazK4=; b=iHvfIKmNxp9JxGQV46iWtPeoV ks9+VAq/hKX4fdWsGRx5c6Omifd4qhqaUqT0iy7bfmrA/vdgVHGjvUa/0XTvD5UrjCU+6d6pnDapb 5uExaBY25Lbkl7OirjCho6dKZTLNOYcIKLjycP85KLS0tSz3sv0ffNjimfgwuBKPXZ1Tf+yAY89Yx AhiYuPehKZebl+pipBdWPuTcMpuOCU/nppIUQ8YdTRB7qkJKbuGiqyNIi8vBT+VPCd/Se/TFHnBQy EsG82N+3pNAwmYHlKgafhm2d7nEIHOXji8XT4oLZvTLmBGLl9gYI5c+kbYPW4S43DDCmpyS82dGmW jtioCZoyQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPZA6-0002zC-I2; Wed, 21 Nov 2018 20:31:50 +0000 Date: Wed, 21 Nov 2018 12:31:50 -0800 From: Matthew Wilcox 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 , David Howells , KJ Tsanaktsidis , "open list:DOCUMENTATION" Subject: Re: [PATCH] Add /proc/pid_generation 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 Content-Disposition: inline In-Reply-To: <20181121201452.77173-1-dancol@google.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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?