linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] FUSE: add another flag to support shared mmap in FOPEN_DIRECT_IO mode
@ 2023-05-02  7:28 Hao Xu
  2023-05-02  7:37 ` Bernd Schubert
  0 siblings, 1 reply; 3+ messages in thread
From: Hao Xu @ 2023-05-02  7:28 UTC (permalink / raw)
  To: fuse-devel, miklos; +Cc: Antonio SJ Musumeci, linux-fsdevel, Bernd Schubert

Hi all,

 From discussion with Bernd, I get that FOPEN_DIRECT_IO is designed for 
those user cases where users want strong coherency like network 
filesystems, where one server serves multiple remote clients. And thus 
shared mmap is disabled since local page cache existence breaks this 
kind of coherency.

But here our use case is one virtiofs daemon serve one guest vm, We use 
FOPEN_DIRECT_IO to reduce memory footprint not for coherency. So we 
expect shared mmap works in this case. Here I suggest/am implementing 
adding another flag to indicate this kind of cases----use 
FOPEN_DIRECT_IO not for coherency----so that shared mmap works.


Thanks,

Hao


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] FUSE: add another flag to support shared mmap in FOPEN_DIRECT_IO mode
  2023-05-02  7:28 [RFC] FUSE: add another flag to support shared mmap in FOPEN_DIRECT_IO mode Hao Xu
@ 2023-05-02  7:37 ` Bernd Schubert
  2023-05-03  5:09   ` Hao Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Bernd Schubert @ 2023-05-02  7:37 UTC (permalink / raw)
  To: Hao Xu, fuse-devel, miklos; +Cc: Antonio SJ Musumeci, linux-fsdevel

Hi Hao,

On 5/2/23 09:28, Hao Xu wrote:
> Hi all,
> 
>  From discussion with Bernd, I get that FOPEN_DIRECT_IO is designed for 
> those user cases where users want strong coherency like network 
> filesystems, where one server serves multiple remote clients. And thus 
> shared mmap is disabled since local page cache existence breaks this 
> kind of coherency.
> 
> But here our use case is one virtiofs daemon serve one guest vm, We use 
> FOPEN_DIRECT_IO to reduce memory footprint not for coherency. So we 
> expect shared mmap works in this case. Here I suggest/am implementing 
> adding another flag to indicate this kind of cases----use 
> FOPEN_DIRECT_IO not for coherency----so that shared mmap works.

Yeah it should work, but I think what you want is "DAX" - can you try to 
enable it?

fuse_i.h:	FUSE_DAX_ALWAYS,	/* "-o dax=always" */
fuse_i.h:	FUSE_DAX_NEVER,		/* "-o dax=never" */
fuse_i.h:	FUSE_DAX_INODE_USER,	/* "-o dax=inode" */



Hope it helps,
Bernd

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] FUSE: add another flag to support shared mmap in FOPEN_DIRECT_IO mode
  2023-05-02  7:37 ` Bernd Schubert
@ 2023-05-03  5:09   ` Hao Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Hao Xu @ 2023-05-03  5:09 UTC (permalink / raw)
  To: Bernd Schubert, fuse-devel, miklos; +Cc: Antonio SJ Musumeci, linux-fsdevel

Hi Bernd,


On 5/2/23 15:37, Bernd Schubert wrote:
> Hi Hao,
>
> On 5/2/23 09:28, Hao Xu wrote:
>> Hi all,
>>
>>  From discussion with Bernd, I get that FOPEN_DIRECT_IO is designed 
>> for those user cases where users want strong coherency like network 
>> filesystems, where one server serves multiple remote clients. And 
>> thus shared mmap is disabled since local page cache existence breaks 
>> this kind of coherency.
>>
>> But here our use case is one virtiofs daemon serve one guest vm, We 
>> use FOPEN_DIRECT_IO to reduce memory footprint not for coherency. So 
>> we expect shared mmap works in this case. Here I suggest/am 
>> implementing adding another flag to indicate this kind of 
>> cases----use FOPEN_DIRECT_IO not for coherency----so that shared mmap 
>> works.
>
> Yeah it should work, but I think what you want is "DAX" - can you try 
> to enable it?
>
> fuse_i.h:    FUSE_DAX_ALWAYS,    /* "-o dax=always" */
> fuse_i.h:    FUSE_DAX_NEVER,        /* "-o dax=never" */
> fuse_i.h:    FUSE_DAX_INODE_USER,    /* "-o dax=inode" */
>
>
>
> Hope it helps,
> Bernd


Thanks for your suggestion, the thing is most IO in our case are small 
random read to small files. I believe Dax should help but doubt it may 
be not too much.

Another reason we are not leveraging DAX is the hypervisor software we 
use doesn't support DAX well. So I think the feature in this RFC should 
be good for

some non-DAX use cases (like ours)


Thanks,

Hao


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-03  5:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02  7:28 [RFC] FUSE: add another flag to support shared mmap in FOPEN_DIRECT_IO mode Hao Xu
2023-05-02  7:37 ` Bernd Schubert
2023-05-03  5:09   ` Hao Xu

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).