From: Randy Dunlap <rdunlap@infradead.org>
To: Luis Chamberlain <mcgrof@kernel.org>,
ebiederm@xmission.com, corbet@lwn.net, keescook@chromium.org,
yzaikin@google.com
Cc: songmuchun@bytedance.com, zhangyuchen.lcr@bytedance.com,
dhowells@redhat.com, deepa.kernel@gmail.com, hch@lst.de,
linux-doc@vger.kernel.org, linux-api@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Documentation/filesystems/proc.rst: document procfs inode timestamps
Date: Fri, 22 Jul 2022 12:56:09 -0700 [thread overview]
Message-ID: <d0c9c894-bfff-e3ee-c1be-84b7690a7a86@infradead.org> (raw)
In-Reply-To: <20220722162934.1888835-3-mcgrof@kernel.org>
Hi--
On 7/22/22 09:29, Luis Chamberlain wrote:
> The timestamps for procfs files are not well understood and can
> confuse users and developers [0] in particular for the timestamp
> for the start time or a process. Clarify what they mean and that
> they are a reflection of the ephemeral nature of the filesystem
> inodes.
>
> The procfs inodes are created when you first read them and then
> stuffed in the page cache. If the page cache and indodes are
> reclaimed they can be removed, and re-created with a new timestamp
> after read again. Document this little bit of tribal knowledge.
>
> [0] https://lkml.kernel.org/r/20220721081617.36103-1-zhangyuchen.lcr@bytedance.com
> Reported-by: Zhang Yuchen <zhangyuchen.lcr@bytedance.com>
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
> Documentation/filesystems/proc.rst | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
> index 9fd5249f1a5f..9defe9af683a 100644
> --- a/Documentation/filesystems/proc.rst
> +++ b/Documentation/filesystems/proc.rst
> @@ -59,6 +59,15 @@ The proc file system acts as an interface to internal data structures in the
> kernel. It can be used to obtain information about the system and to change
> certain kernel parameters at runtime (sysctl).
>
> +The proc files are dynamic in nature and allow for developers to make the
Awkward. How about:
The proc files are dynamic and allow for the content to be changed each time
a file is read.
> +content to be changed each time a file is read. The proc files and directories
The proc files and directory
> +inodes are created when someone first reads a respective proc file or directory,
> +as such the timestamps of the proc files reflect this time. As with other
> +filesystems, these proc inodes can be removed through reclaim under memory
> +pressure and so the timestamps of the proc files can change if the proc files
> +are destroyed and re-created (echo 3 > /proc/sys/vm/drop_caches forces and
> +illustrate the reclaim of inodes and page cache).
> +
> First, we'll take a look at the read-only parts of /proc. In Chapter 2, we
> show you how you can use /proc/sys to change settings.
Thanks.
--
~Randy
next prev parent reply other threads:[~2022-07-22 19:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-22 16:29 [PATCH 0/2] procfs: document proc timestamps Luis Chamberlain
2022-07-22 16:29 ` [PATCH 1/2] Documentation/filesystems/proc.rst: remove ancient boiler plate Luis Chamberlain
2022-07-22 16:29 ` [PATCH 2/2] Documentation/filesystems/proc.rst: document procfs inode timestamps Luis Chamberlain
2022-07-22 19:56 ` Randy Dunlap [this message]
2022-07-23 14:17 ` Muchun Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d0c9c894-bfff-e3ee-c1be-84b7690a7a86@infradead.org \
--to=rdunlap@infradead.org \
--cc=corbet@lwn.net \
--cc=deepa.kernel@gmail.com \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=hch@lst.de \
--cc=keescook@chromium.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=songmuchun@bytedance.com \
--cc=yzaikin@google.com \
--cc=zhangyuchen.lcr@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).