[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181107171644.GK3074@bombadil.infradead.org>
Date: Wed, 7 Nov 2018 09:16:44 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Mike Rapoport <rppt@...ux.ibm.com>
Cc: Daniel Colascione <dancol@...gle.com>,
linux-kernel@...r.kernel.org, timmurray@...gle.com,
joelaf@...gle.com, surenb@...gle.com,
Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
Roman Gushchin <guro@...com>, Vlastimil Babka <vbabka@...e.cz>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"Dennis Zhou (Facebook)" <dennisszhou@...il.com>,
Prashant Dhamdhere <pdhamdhe@...hat.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v2] Document /proc/pid PID reuse behavior
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/<pid> or to any of its
"open file descriptor" (the "a" is unnecessary)
> > +contained files or subdirectories does not prevent <pid> being reused
> > +for some other process in the event that <pid> exits. Operations on
> > +open /proc/<pid> file descriptors corresponding to dead processes
> > +never act on any new process that the kernel may, through chance, have
> > +also assigned the process ID <pid>. Instead, operations on these FDs
> > +usually fail with ESRCH.
The paragraph is a bit wordy. More pithy:
An open file descriptor for /proc/<pid> (or any of the files or
subdirectories in it) does not prevent <pid> 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 <pid>.
Powered by blists - more mailing lists