[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181101070856.GB8866@rapoport-lnx>
Date: Thu, 1 Nov 2018 09:08:57 +0200
From: Mike Rapoport <rppt@...ux.ibm.com>
To: Daniel Colascione <dancol@...gle.com>
Cc: 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>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Vlastimil Babka <vbabka@...e.cz>,
"Dennis Zhou (Facebook)" <dennisszhou@...il.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Prashant Dhamdhere <pdhamdhe@...hat.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [PATCH] Document /proc/pid PID reuse behavior
On Wed, Oct 31, 2018 at 03:06:22PM +0000, Daniel Colascione wrote:
> State explicitly that holding a /proc/pid file descriptor open does
> not reserve the PID. Also note that in the event of PID reuse, these
> open file descriptors refer to the old, now-dead process, and not the
> new one that happens to be named the same numeric PID.
Signed-off is missing.
> ---
> Documentation/filesystems/proc.txt | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
> index 12a5e6e693b6..567f66a8a23c 100644
> --- a/Documentation/filesystems/proc.txt
> +++ b/Documentation/filesystems/proc.txt
> @@ -214,6 +214,14 @@ asynchronous manner and the value may not be very precise. To see a precise
> snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table.
> It's slow but very precise.
>
> +Note that an open a file descriptor to /proc/<pid> or to any of its
> +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.
> +
I'd put this text in the beginning of the section, just before table 1-1.
Otherwise looks good.
It maybe also useful to update 'man 5 proc' (1) as well
[1] https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man5/proc.5
> Table 1-2: Contents of the status files (as of 4.8)
> ..............................................................................
> Field Content
> --
> 2.19.1.568.g152ad8e336-goog
>
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists