[Virtio-fs] [PATCH RESEND][RFC] virtiofsd: do not fall back to buffer io when cache=auto/always

Vivek Goyal vgoyal at redhat.com
Wed Aug 21 14:47:57 UTC 2019


On Wed, Aug 21, 2019 at 10:38:39PM +0800, piaojun wrote:

[..]
> >>
> >> You cleared my first doubt that 'fi->direct_io' and 'fi->keep_cache'
> >> are used to control Guest I/O mode together, and there may be different
> >> I/O modes between Guest and Host if I undersatnd it correctly. I admit
> >> this offers a more flexible config to user, but also introduces more
> >> complex option. Maybe we could just use *keep_cache* to handle all
> >> these options.
> >>
> >> My second doubt is that *keep_cache* is used to control whether reusing
> >> the cache of last open(). IMO, it has nothing to do with the following
> >> I/O path.
> > 
> > FOPEN_KEEP_CACHE is already part of fuse protocol. cache=always is just
> > making use of that option so that cache contents are not discarded upon
> > next open.
> 
> It still confused me that probably we needn't set fi->direct_io if
> CACHE_NONE is set to indicate Guest go direct I/O path. As Guest could
> also go direct I/O through regular path you have mentioned above.

fi->direct_io is needed so that server can *enforce* direct I/O on guest.
If guest applications are not doing direct I/O, without fi->direct_io,
you can't force client to do direct I/O.

Vivek




More information about the Virtio-fs mailing list