FUSE Introducing Per-File DAX Option With Linux 5.17

Written by Michael Larabel in Linux Storage on 19 December 2021 at 05:34 AM EST. 6 Comments
Last year with Linux 5.10 FUSE added DAX support for use with VirtIO-FS. Like with DAX for other file-systems, enabling this direct access mode allows bypassing the page cache. For use-cases when running on persistent memory like devices or VirtIO, having this direct access to the storage device can be beneficial for performance. With Linux 5.17 FUSE is expanding the DAX support to allow per-inode control as well.

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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week