Skip to content

Conversation

@elee1766
Copy link
Contributor

@elee1766 elee1766 commented Nov 11, 2025

adds fuse passthrough support to etcfs https://docs.kernel.org/6.16/filesystems/fuse-passthrough.html

checks for ETCFS_ENABLE_PASSTHROUGH env var to be 1 or yes to enable. it will fail to enable if the kernel does not support it, even if the env var is set.

requires a kernel 6.9+ compiled with FUSE_CAP_PASSTHROUGH (enabled by default)

i think it should come disabled out of the box, in case of possible bugs. i think that the changes to the non-passthrough paths are non-invasive enough that this feels safe.

what does fuse passthrough do:

in "traditional" fuse, on m_open/m_create, when interacting with an existing underlying filesystem, we open the fd, and then when m_read/m_write fuse callback is called, we read/write from said fd. this comes with the unfortunate side effect of forcing user-kernel space copies and context switches.

instead, with fuse passthrough, we can use ioctl to register the fd we open in m_open/m_crate with the kernel and obtain a "backing_id". this "backing_id", when added to the fuse id, allows fuse to skip the call to m_read/m_write, and "passthrough" the call to read/write directly to the fd registered with the backing id, thereby circumventing the requirement to cross user-kernel barrier

the consequences for etcfs are as follows:

  1. two extra ioctl syscalls, one to register the backing fd on open/create, and one to unregister it on close.
  2. no calls to m_read/m_write when a proxied fd is read or written once open, by etcfs.

limited benchmarks on my machine come back with these results. take these with a grain of salt. it is some ai generated python slop that i used to make the benchmark. i get varying results every time i run it, but it is always positive at least on my machine so far.
(14900@5.8ghz, btrfs on nvme, debian 13 kernel 6.12.48)

## WRITE TIMES

| Workload | Native | Traditional | Passthrough | PT Speedup |
|----------|--------|-------------|-------------|------------|
| 25k × 4KB (tiny files)       |  0.310s |       5.805s |       4.660s |       1.25x |
| 10k × 64KB (small files)     |  0.238s |       2.878s |       1.841s |       1.56x |
| 1k × 1MB (medium files)      |  0.194s |       1.019s |       0.549s |       1.86x |
| 100 × 10MB (large files)     |  0.213s |       0.678s |       0.265s |       2.55x |

## READ TIMES

| Workload | Native | Traditional | Passthrough | PT Speedup |
|----------|--------|-------------|-------------|------------|
| 25k × 4KB (tiny files)       |  0.099s |       5.633s |       4.211s |       1.34x |
| 10k × 64KB (small files)     |  0.119s |       3.058s |       1.896s |       1.61x |
| 1k × 1MB (medium files)      |  0.123s |       0.831s |       0.349s |       2.38x |
| 100 × 10MB (large files)     |  0.130s |       0.389s |       0.155s |       2.51x |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant