All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Xiubo Li <xiubli@redhat.com>
Cc: idryomov@gmail.com, vshankar@redhat.com,
	ceph-devel@vger.kernel.org, Gregory Farnum <gfarnum@redhat.com>
Subject: Re: [RFC PATCH] ceph: disable updating the atime since cephfs won't maintain it
Date: Wed, 20 Apr 2022 09:56:59 -0400	[thread overview]
Message-ID: <5b6832315f8561010bb2a7dd93638752ebf8166b.camel@kernel.org> (raw)
In-Reply-To: <20220420052404.1144209-1-xiubli@redhat.com>

On Wed, 2022-04-20 at 13:24 +0800, Xiubo Li wrote:
> Since the cephFS makes no attempt to maintain atime, we shouldn't
> try to update it in mmap and generic read cases and ignore updating
> it in direct and sync read cases.
> 
> And even we update it in mmap and generic read cases we will drop
> it and won't sync it to MDS. And we are seeing the atime will be
> updated and then dropped to the floor again and again.
> 
> URL: https://lists.ceph.io/hyperkitty/list/ceph-users@ceph.io/thread/VSJM7T4CS5TDRFF6XFPIYMHP75K73PZ6/
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/addr.c  | 1 -
>  fs/ceph/super.c | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index aa25bffd4823..02722ac86d73 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -1774,7 +1774,6 @@ int ceph_mmap(struct file *file, struct vm_area_struct *vma)
>  
>  	if (!mapping->a_ops->readpage)
>  		return -ENOEXEC;
> -	file_accessed(file);
>  	vma->vm_ops = &ceph_vmops;
>  	return 0;
>  }
> diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> index e6987d295079..b73b4f75462c 100644
> --- a/fs/ceph/super.c
> +++ b/fs/ceph/super.c
> @@ -1119,6 +1119,7 @@ static int ceph_set_super(struct super_block *s, struct fs_context *fc)
>  	s->s_time_gran = 1;
>  	s->s_time_min = 0;
>  	s->s_time_max = U32_MAX;
> +	s->s_flags |= SB_NODIRATIME | SB_NOATIME;
>  
>  	ret = set_anon_super_fc(s, fc);
>  	if (ret != 0)

(cc'ing Greg since he claimed this...)

I confess, I've never dug into the MDS code that should track atime, but
I'm rather surprised that the MDS just drops those updates onto the
floor.

It's obviously updated when the mtime changes. The SETATTR operation
allows the client to set the atime directly, and there is an "atime"
slot in the cap structure that does get populated by the client. I guess
though that it has never been 100% clear what cap the atime should be
governed by so maybe it just always ignores that field?

Anyway, I've no firm objection to this since no one in their right mind
should use the atime anyway, but you may see some complaints if you just
turn it off like this. There are some applications that use it.
Hopefully no one is running those on ceph.

It would be nice to document this somewhere as well -- maybe on the ceph
POSIX conformance page?

    https://docs.ceph.com/en/latest/cephfs/posix/

-- 
Jeff Layton <jlayton@kernel.org>

  parent reply	other threads:[~2022-04-20 13:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  5:24 [RFC PATCH] ceph: disable updating the atime since cephfs won't maintain it Xiubo Li
2022-04-20 12:57 ` Xiubo Li
2022-04-20 13:56 ` Jeff Layton [this message]
2022-04-20 14:08   ` Gregory Farnum
2022-04-21  1:12     ` Xiubo Li
2022-04-21  1:08   ` Xiubo Li
2022-04-21  7:18   ` Xiubo Li

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=5b6832315f8561010bb2a7dd93638752ebf8166b.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=gfarnum@redhat.com \
    --cc=idryomov@gmail.com \
    --cc=vshankar@redhat.com \
    --cc=xiubli@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.