From: Yongji Xie <xieyongji@bytedance.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, 张佳辰 <zhangjiachen.jaycee@bytedance.com>
Subject: Re: [RFC] fuse: Avoid invalidating attrs if writeback_cache enabled
Date: Mon, 18 Oct 2021 19:25:31 +0800 [thread overview]
Message-ID: <CACycT3s=aC6eWfo0LHMuE6sVVErjkZPScsgaBGn4QABbZE2a9g@mail.gmail.com> (raw)
In-Reply-To: <CAJfpeguaRjQ9Fd1S4NHx5XVF89PGgFBxW3Xf=XNrb1QQRbDbYQ@mail.gmail.com>
On Wed, Oct 13, 2021 at 9:52 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Mon, 11 Oct 2021 at 16:45, Yongji Xie <xieyongji@bytedance.com> wrote:
> >
> > On Mon, Oct 11, 2021 at 9:21 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
> > >
> > > On Mon, 11 Oct 2021 at 11:07, Xie Yongji <xieyongji@bytedance.com> wrote:
> > > >
> > > > Recently we found the performance of small direct writes is bad
> > > > when writeback_cache enabled. This is because we need to get
> > > > attrs from userspace in fuse_update_get_attr() on each write.
> > > > The timeout for the attributes doesn't work since every direct write
> > > > will invalidate the attrs in fuse_direct_IO().
> > > >
> > > > To fix it, this patch tries to avoid invalidating attrs if writeback_cache
> > > > is enabled since we should trust local size/ctime/mtime in this case.
> > >
> > > Hi,
> > >
> > > Thanks for the patch.
> > >
> > > Just pushed an update to
> > > git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.gitt#for-next
> > > (9ca3f8697158 ("fuse: selective attribute invalidation")) that should
> > > fix this behavior.
> > >
> >
> > Looks like fuse_update_get_attr() will still get attrs from userspace
> > each time with this commit applied.
> >
> > > Could you please test?
> > >
> >
> > I applied the commit 9ca3f8697158 ("fuse: selective attribute
> > invalidation") and tested it. But the issue still exists.
>
> Yeah, my bad. Pushed a more complete set of fixes to #for-next ending with
>
> e15a9a5fca6c ("fuse: take cache_mask into account in getattr")
>
> You should pull or cherry pick the complete branch.
>
I tested this branch, but it still doesn't fix this issue. The
inval_mask = 0x6C0 and cache_mask = 0x2C0, so we still need to get
attrs from userspace. Should we add STATX_BLOCKS to cache_mask?
Thanks,
Yongji
next prev parent reply other threads:[~2021-10-18 11:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 9:02 [RFC] fuse: Avoid invalidating attrs if writeback_cache enabled Xie Yongji
2021-10-11 13:21 ` Miklos Szeredi
2021-10-11 14:45 ` Yongji Xie
2021-10-13 13:52 ` Miklos Szeredi
2021-10-18 11:25 ` Yongji Xie [this message]
2021-10-18 11:45 ` Miklos Szeredi
2021-10-18 13:08 ` Yongji Xie
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='CACycT3s=aC6eWfo0LHMuE6sVVErjkZPScsgaBGn4QABbZE2a9g@mail.gmail.com' \
--to=xieyongji@bytedance.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=zhangjiachen.jaycee@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).