From: JeffleXu <jefflexu@linux.alibaba.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Vivek Goyal <vgoyal@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
virtio-fs-list <virtio-fs@redhat.com>,
linux-fsdevel@vger.kernel.org,
Joseph Qi <joseph.qi@linux.alibaba.com>
Subject: Re: [PATCH v7 6/7] fuse: mark inode DONT_CACHE when per inode DAX hint changes
Date: Thu, 11 Nov 2021 09:46:26 +0800 [thread overview]
Message-ID: <c41837f0-a183-d911-885d-cf3bcdd9b7c8@linux.alibaba.com> (raw)
In-Reply-To: <CAJfpegvfQbA32HjqWv9-Ds04W7Qs2idTOP7w5_NvKS_n=0Td7Q@mail.gmail.com>
On 11/10/21 11:50 PM, Miklos Szeredi wrote:
> On Tue, 2 Nov 2021 at 06:26, Jeffle Xu <jefflexu@linux.alibaba.com> wrote:
>>
>> When the per inode DAX hint changes while the file is still *opened*, it
>> is quite complicated and maybe fragile to dynamically change the DAX
>> state.
>>
>> Hence mark the inode and corresponding dentries as DONE_CACHE once the
>> per inode DAX hint changes, so that the inode instance will be evicted
>> and freed as soon as possible once the file is closed and the last
>> reference to the inode is put. And then when the file gets reopened next
>> time, the new instantiated inode will reflect the new DAX state.
>>
>> In summary, when the per inode DAX hint changes for an *opened* file, the
>> DAX state of the file won't be updated until this file is closed and
>> reopened later.
>
> This patch does nothing, since fuse already uses .drop_inode =
> generic_delete_inode, which is has the same effect as setting
> I_DONTCACHE, at least in the fuse case (inode should never be dirty at
> eviction).
Yes, it is. .drop_inode() of FUSE will always free inode. Here we only
need to set dentry as DCACHE_DONTCACHE. Here I just call
d_mark_dontcache() directly, though I_DONTCACHE is useless but harmless
in the case of FUSE...
> In fact it may be cleaner to set I_DONTCACHE
> unconditionally and remove the .drop_inode callback setting.
It works in both cases, I mean, in current case (current code retained
untouched) and the case you described above.
--
Thanks,
Jeffle
next prev parent reply other threads:[~2021-11-11 1:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 5:25 [PATCH v7 0/7] fuse,virtiofs: support per-file DAX Jeffle Xu
2021-11-02 5:25 ` [PATCH v7 1/7] fuse: add fuse_should_enable_dax() helper Jeffle Xu
2021-11-02 5:25 ` [PATCH v7 2/7] fuse: make DAX mount option a tri-state Jeffle Xu
2021-11-11 18:52 ` Vivek Goyal
2021-11-12 1:52 ` JeffleXu
2021-11-02 5:26 ` [PATCH v7 3/7] fuse: support per inode DAX in fuse protocol Jeffle Xu
2021-11-02 5:26 ` [PATCH v7 4/7] fuse: enable per inode DAX Jeffle Xu
2021-11-02 5:26 ` [PATCH v7 5/7] fuse: negotiate per inode DAX in FUSE_INIT Jeffle Xu
2021-11-11 19:45 ` Vivek Goyal
2021-11-12 2:04 ` JeffleXu
2021-11-02 5:26 ` [PATCH v7 6/7] fuse: mark inode DONT_CACHE when per inode DAX hint changes Jeffle Xu
2021-11-10 15:50 ` Miklos Szeredi
2021-11-11 1:46 ` JeffleXu [this message]
2021-11-11 20:33 ` Vivek Goyal
2021-11-12 1:31 ` JeffleXu
2021-11-02 5:26 ` [PATCH v7 7/7] Documentation/filesystem/dax: record DAX on virtiofs Jeffle Xu
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=c41837f0-a183-d911-885d-cf3bcdd9b7c8@linux.alibaba.com \
--to=jefflexu@linux.alibaba.com \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=stefanha@redhat.com \
--cc=vgoyal@redhat.com \
--cc=virtio-fs@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 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).