Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3373249imu; Wed, 7 Nov 2018 09:19:07 -0800 (PST) X-Google-Smtp-Source: AJdET5csC+URZ+8ufdLBsRx8NS5WMuEd2oPliLq48emInIQYV9Yz/zICvaRlwt9AuAdbZjMOsAYl X-Received: by 2002:a62:5b43:: with SMTP id p64-v6mr1087384pfb.122.1541611146933; Wed, 07 Nov 2018 09:19:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541611146; cv=none; d=google.com; s=arc-20160816; b=Uu1K8aLU1r6cPI20AOStv272NnyzqZTIUoiC9hb45DmUMCZ5m+lsNdSsGhF6e9Wy6r 1qpAzS0RGilMzme0CthLzXCHiDDTVll8fcNp93Q3rDellVgui6YFsDKL91yTRkudiB5n bwazy8Rwbp+bDJiY4GzAGLdgCKsol049Hx2igzmtgQGBXriMoOdzyKrq7YETkBoIpoYD vs7nUHN/b83ijEPgEP2FwyZgeUSOgzv4vNpxbGuDJ5wz7mILePKleBs4cb3vWsD6BmiX +6Y9uq1x5X7GfwHE10803K3EstskaxUH2/hs0AjpNKxUzl2akir4KpnQ90j+RN7dmR7U kxrA== 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=NNpnCzR2QQAKynW5TjEUeevcpIewY978IDwI5s4Vbz0=; b=sYr8kPGkxwd4SqOTRPTrRt0/5qR2zpYlvuJOVpb09qyF7TGfef5Fv9kdt7Dzh0fjI/ u948J2A9tmqmAxPEtu+684g83XNiC4bn7WCsbT2aRAl/sQEcyvZHUcI46P6QKYfBIvfT 5ND2pp1EblvlAwU3nAFeWvzm73bq8r35uVTPpdvZ/SHNW4zzCzMO5QqznAchRpLyrFOA 0KK+iUfqWlS9+rqgJS60m7eimvODjNvofxCJdoC3vW4uPnoqqKbzzBAaam7C/B7tZaGc pchpf4FrWOPJ02Fa5Dlog/MV7wahGCchVG2UX8TCayaGzjoFyB/hLZGdDhxlfx8NruKc e3kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Z59vj1zs; 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 u7-v6si1192630pfu.143.2018.11.07.09.18.51; Wed, 07 Nov 2018 09:19:06 -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=Z59vj1zs; 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 S1728143AbeKHCsD (ORCPT + 99 others); Wed, 7 Nov 2018 21:48:03 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:55828 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727870AbeKHCsD (ORCPT ); Wed, 7 Nov 2018 21:48:03 -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=NNpnCzR2QQAKynW5TjEUeevcpIewY978IDwI5s4Vbz0=; b=Z59vj1zsAjVNV1ghlaFOe+ASb IysUvia6w6DjGBxTrmQqJh0KhFl6XpaALPIC1cOWB913TjzPfmMkulicnHeWEV3/pTGgLSOjZJ9eV p7gwiIwXIG4a0bRq00F/xoAtSbY4wsl5FuRnEhNvusxFepZiW4aujAIXZwUuFNXWuPH2aKUCK1bsK SKbYvAluc9UUWztRrQm2VnRJ94Ngoo+dkQWcvEOx/u32ybzXPd7qvlJGMXY+T2qsKHAOG75jCF/bS oqvsafSb4fhnkgrj5zgfnUQbK8OaXPSXML/ok+JOXsgMF76VdAUflJTclAj2F3zg5CzesHr8AmbhM 9FsGT0dsA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKRRc-0007zB-67; Wed, 07 Nov 2018 17:16:44 +0000 Date: Wed, 7 Nov 2018 09:16:44 -0800 From: Matthew Wilcox To: Mike Rapoport Cc: Daniel Colascione , linux-kernel@vger.kernel.org, timmurray@google.com, joelaf@google.com, surenb@google.com, Jonathan Corbet , Andrew Morton , Roman Gushchin , Vlastimil Babka , "Kirill A. Shutemov" , "Dennis Zhou (Facebook)" , Prashant Dhamdhere , "open list:DOCUMENTATION" Subject: Re: [PATCH v2] Document /proc/pid PID reuse behavior Message-ID: <20181107171644.GK3074@bombadil.infradead.org> References: <20181031150625.147369-1-dancol@google.com> <20181105132205.138695-1-dancol@google.com> <20181106060113.GA4499@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181106060113.GA4499@rapoport-lnx> 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 Tue, Nov 06, 2018 at 08:01:13AM +0200, Mike Rapoport wrote: > > diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt > > index 12a5e6e693b6..0b14460f721d 100644 > > --- a/Documentation/filesystems/proc.txt > > +++ b/Documentation/filesystems/proc.txt > > @@ -125,6 +125,13 @@ process running on the system, which is named after the process ID (PID). > > The link self points to the process reading the file system. Each process > > subdirectory has the entries listed in Table 1-1. > > > > +Note that an open a file descriptor to /proc/ or to any of its "open file descriptor" (the "a" is unnecessary) > > +contained files or subdirectories does not prevent being reused > > +for some other process in the event that exits. Operations on > > +open /proc/ file descriptors corresponding to dead processes > > +never act on any new process that the kernel may, through chance, have > > +also assigned the process ID . Instead, operations on these FDs > > +usually fail with ESRCH. The paragraph is a bit wordy. More pithy: An open file descriptor for /proc/ (or any of the files or subdirectories in it) does not prevent from being reused after the process exits. Operations on a file descriptor referring to a dead process usually return ESRCH. They do not act on any new process which has been assigned the same .