Hi,

We have a case where our virtio-fs FUSE device (running on Bluefield DPU) needs 
to invalidate some of its internal file objects, so that it can free memory to 
be used for file objects for newly looked up files. We cannot rely on the host 
to invalidate entries itself since it typically has far more memory for its 
caches than is available on a real hardware device for its file object caching.

We would like to use the FUSE_NOTIFY_INVAL_ENTRY notification to ask the host 
to invalidate inodes, triggering FUSE FORGET commands that will enable the 
device to free its associated file objects for those inodes. We cannot find any 
documentation that explicitly says FUSE_NOTIFY_INVAL_ENTRY can be used for this 
purpose. But initial testing and code inspection indicates that this does 
trigger the FORGET commands that allow us to free some of the file objects in 
device memory.

Can we safely depend on the FUSE_NOTIFY_INVAL_ENTRY notifications to trigger 
FORGET commands for the associated inodes? If not, can we consider adding a new 
FUSE_NOTIFY_DROP_ENTRY notification that would ask the kernel to release the 
inode and send a FORGET command when memory pressure or clean-up is needed by 
the device?

Best regards,

Jim Harris

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to