linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Jeremy Cline <jcline@redhat.com>,
	David Both <dboth@millennium-technology.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: update i_atime when reading files
Date: Fri, 22 Feb 2019 08:37:42 +0300	[thread overview]
Message-ID: <20190222053742.GA4270@avx2> (raw)
In-Reply-To: <20190221163714.22330-1-jcline@redhat.com>

On Thu, Feb 21, 2019 at 11:37:14AM -0500, Jeremy Cline wrote:
> Prior to commit 1da4d377f943 ("proc: revalidate misc dentries"), the
> access, modify, and change times of files in /proc were just the current
> time.

Ehh, actually no. Doing

	$(which sleep) infinity </proc/foo &

will sabotage atime updates because dentry and inode will be pinned in
caches.

"revalidate misc denries" commit simply makes the effect (much) more
visible by making objects stay in caches for longer.

> Now the mtime and ctime values change mostly as a user would
> expect, but the atime isn't updated when the file read. This patch
> updates the access time of /proc files when they are read.

>  			rv = read(file, buf, count, ppos);
> +			if (rv >= 0)
> +				inode->i_atime = current_time(inode);
> +		}

Maybe it should be done given /proc is virtual so there are no concerns
about scheduling writes noone cares about to the filesystem.

  reply	other threads:[~2019-02-22  5:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 16:37 [PATCH] proc: update i_atime when reading files Jeremy Cline
2019-02-22  5:37 ` Alexey Dobriyan [this message]
2019-02-22 15:00   ` Jeremy Cline
2019-02-25 19:47     ` Alexey Dobriyan

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=20190222053742.GA4270@avx2 \
    --to=adobriyan@gmail.com \
    --cc=dboth@millennium-technology.com \
    --cc=jcline@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).