FUSE Introducing Per-File DAX Option With Linux 5.17
This work has been going on the past number of months to ultimately allow FUSE and VirtIO-FS to support per-file direct access (DAX). From the patch series her is the motivation for offering this finer-grained control:
DAX may be limited in some specific situation. When the number of usable DAX windows is under watermark, the recalim routine will be triggered to reclaim some DAX windows. It may have a negative impact on the performance, since some processes may need to wait for DAX windows to be recalimed and reused then. To mitigate the performance degradation, the overall DAX window need to be expanded larger.
However, simply expanding the DAX window may not be a good deal in some scenario. To maintain one DAX window chunk (i.e., 2MB in size), 32KB (512 * 64 bytes) memory footprint will be consumed for page descriptors inside guest, which is greater than the memory footprint if it uses guest page cache when DAX disabled. Thus it'd better disable DAX for those files smaller than 32KB, to reduce the demand for DAX window and thus avoid the unworthy memory overhead.
Per-file DAX feature is introduced to address this issue, by offering a finer grained control for dax to users, trying to achieve a balance between performance and memory overhead.
The patch series by Alibaba's Jeffle Xu makes the FUSE infrastructure changes and protocol support for handling per-inode DAX, which comes out slightly different than the DAX behavior under other file-systems like XFS and EXT4. The per-inode behavior can be enabled with the dax=inode mount option.
This work was queued up this week in FUSE for-next ahead of the Linux 5.17 merge window.