Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3443090imu; Wed, 7 Nov 2018 10:22:51 -0800 (PST) X-Google-Smtp-Source: AJdET5fnrC3iiLK+0kIhFeqbyvWzqDl3bkb3cbtdNXv4iS86B7IBNv7xpClLeHDZmVRSBwLIYDO2 X-Received: by 2002:a63:480d:: with SMTP id v13-v6mr1075462pga.308.1541614971350; Wed, 07 Nov 2018 10:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541614971; cv=none; d=google.com; s=arc-20160816; b=UVx3TII3f4lmejzC0fENgRT62FegBfszgDoPkr7OJi32IEDUNeOfPhhTadUL/UkdGX R0rr/qVWRvUvo5SuWC2jPcgGP7flnXKis6Aob9vdv7rLLHn9lX/Nji6SjOyjDiO57D1P TkS9CRq20+39FoJVYX/02fqXj3lNVy2TLQoCBYyM/NEfD5nosMvhi1Oos+7eLejJkyoY tyAuIJ8aBiJCsIt2PzDgRo4Yi0jfQaGDaY5XSlS53UGKmoKj5AdQ7OrsvKcy6UevFNqD oN1aT0+DMdOmdTnARaot6VPJLM67J4eYa/IL3F1bA7VPpSRP2fETUJu23arMXM1xCfyL vIgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=QYUaHOK8vceZkSPfI0EfEH6FkTI2Ic5ANXg6IXsWYmc=; b=1KJt56FHrgz5lWTAimpAm+5IUaiekx/5oDjf8ESs22fa0N0g2++6EYod2fh0wXl0jc ifTA5IfFj3KoZBORJdschLI1HRnJwF3UMjQT1308LFaMyIl2+zqHiSG+a7BZtdAWg/lR GTHif47oaKE9Q2CmJC91OYFJuK5YTUs9hf7QQmGrKNU2Q2sT3GVL6zqSWVSZ5GTsexnt pJzJVtSL7U9p1sFsvsR2bxrP3zc1OegR3abSDVxF4AnTzHmqC/Mv+8W2zGOWkpb/W4Me b2PIlxjTtHj/IxIwRi/2SmvmjiajxOzOHjao9+5yxxWtLMHQYWRFSz8CcUuWJEve0INF mChw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YC0wMXgD; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k135-v6si1334311pfd.239.2018.11.07.10.22.36; Wed, 07 Nov 2018 10:22:51 -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=pass header.i=@google.com header.s=20161025 header.b=YC0wMXgD; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727988AbeKHDxg (ORCPT + 99 others); Wed, 7 Nov 2018 22:53:36 -0500 Received: from mail-ua1-f68.google.com ([209.85.222.68]:39351 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbeKHDxg (ORCPT ); Wed, 7 Nov 2018 22:53:36 -0500 Received: by mail-ua1-f68.google.com with SMTP id k10so6195335ual.6 for ; Wed, 07 Nov 2018 10:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QYUaHOK8vceZkSPfI0EfEH6FkTI2Ic5ANXg6IXsWYmc=; b=YC0wMXgD/6JkC3eFtRpoY8AcYg/O2fQU6GGWOAJcEVASz0v8EhaDijJ6+tNso/ndaS UhG7ghlec0rccuB/9cE59afXjOFEdgzJds3q2a8S2IkQp1eZWqvinQXoP7XmJTVrfrPa tqANjZ9HyIJVBsi2+8v7bsxVXUbV28aIFgPJmyENX1ExU+YEhkW9N7FwbJgLawr4htz3 mN0TSDaCAXmHvCWmg7EMkJGzXZNIOEMNcY2EwIDJ/e+LF7sUsuAlT9BLk9T6yAlIsmNm uIXVob+16SlkjLoysy1drf5UbF/11n2aZXRDeO13wfDI4dbIVPYuj6/lrQKWqm+3XbwH m5uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QYUaHOK8vceZkSPfI0EfEH6FkTI2Ic5ANXg6IXsWYmc=; b=UI3GcoWamyxs30+R9IfLEwqGH5ezPQ6rYXZkwmafI1u8YWt5mx8tB2BT/Bk/Bdr8Gv iWglCZjggRz20vGzLoMMdCAT6FlRxZf3hLMZCxR1FP3zs9sr4/AyFG0leKZp3vRGC/Ut YX5p8TbH6ej35l0zHO17q3NqTvrmbtqyilyg+5Tx8mvjkQZmef6pzW3uVsTULhrkopFm u36NZxbWLK78JPkpr1HM2Ig3ZQhFErbcHZQIZEe+WX/BmaHKOr54AIZ6zXesMjKqAun0 H2bb1xWO8OoK3aAdcwpS2xqDx46lptpypXQyaYJAsMJq2qZ7OKrzEg6ugNuRZzFfxsO6 kcmA== X-Gm-Message-State: AGRZ1gKeivH+pqY66HksH5xES/GSo7tcjjUyL6ZpLiYmyqI7ZYRb5lhs /XZ3Hf2AhLu7HRr+vdsy4jkadNbYeABEHuTyjkh56A== X-Received: by 2002:ab0:72a:: with SMTP id h39mr600663uah.11.1541614920550; Wed, 07 Nov 2018 10:22:00 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a67:f48d:0:0:0:0:0 with HTTP; Wed, 7 Nov 2018 10:21:59 -0800 (PST) In-Reply-To: <20181107171644.GK3074@bombadil.infradead.org> References: <20181031150625.147369-1-dancol@google.com> <20181105132205.138695-1-dancol@google.com> <20181106060113.GA4499@rapoport-lnx> <20181107171644.GK3074@bombadil.infradead.org> From: Daniel Colascione Date: Wed, 7 Nov 2018 10:21:59 -0800 Message-ID: Subject: Re: [PATCH v2] Document /proc/pid PID reuse behavior To: Matthew Wilcox Cc: Mike Rapoport , linux-kernel , Tim Murray , Joel Fernandes , Suren Baghdasaryan , Jonathan Corbet , Andrew Morton , Roman Gushchin , Vlastimil Babka , "Kirill A. Shutemov" , "Dennis Zhou (Facebook)" , Prashant Dhamdhere , "open list:DOCUMENTATION" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 7, 2018 at 9:16 AM, Matthew Wilcox wrote: > 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) Thanks for spotting that. I had to re-read that sentence three times or so before even seeing that extra "a". >> > +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 . I'll send a new patch version --- unless we can just tweak the patch when we merge it into the tree?