Serve cache resident reads synchronously#31
Merged
Conversation
vcztools' FormatEncoder now exposes try_cached_read, which returns the requested slice iff it can be served from the encoder's in-memory state without advancing the variant iterator (and is documented safe to call without external synchronisation). Use it as a fast path in StreamHandle.read: when the data is already cached, return inline without acquiring the trio lock or dispatching to a worker thread. On cache miss, fall through to the existing lock-and-dispatch slow path unchanged. Concurrent readahead requests within one loaded chunk no longer serialise on the per-handle lock.
Member
Author
biofuse fs_tests report
Overall: PASS91 / 91 checks passed across 8 runners. Per-runner summary
Runner:
|
| Check | Status | Duration | Detail |
|---|---|---|---|
| open: O_RDONLY succeeds | PASS | 0.002s | |
| open: O_RDONLY | O_NONBLOCK | O_CLOEXEC accepted | PASS |
| open: O_WRONLY rejected with EROFS or EACCES | PASS | 0.000s | |
| open: O_RDWR rejected with EROFS or EACCES | PASS | 0.000s | |
| open: O_APPEND rejected with EROFS or EACCES | PASS | 0.000s | |
| open: O_CREAT for new file rejected | PASS | 0.000s | |
| open: O_DIRECTORY on regular file -> ENOTDIR | PASS | 0.000s | |
| open: O_DIRECTORY on mountpoint -> ok | PASS | 0.000s | |
| open: nonexistent path -> ENOENT | PASS | 0.000s | |
| read: full file via os.read matches backing | PASS | 0.005s | |
| pread: random offsets match backing | PASS | 4.281s | |
| pread: at EOF returns empty | PASS | 0.000s | |
| pread: spanning EOF returns trailing bytes only | PASS | 0.001s | |
| readv / preadv: bytes match backing | PASS | 0.000s | |
| lseek: SEEK_SET / SEEK_CUR / SEEK_END | PASS | 0.001s | |
| lseek: negative offset -> EINVAL | PASS | 0.000s | |
| lseek: past EOF + read -> 0 bytes | PASS | 0.000s | |
| stat == lstat == fstat for regular files | PASS | 0.000s | |
| stat: st_mode is S_IFREG with no write bits | PASS | 0.000s | |
| stat: st_size matches reads | PASS | 0.000s | |
| stat: st_dev consistent across files in mount | PASS | 0.000s | |
| stat: st_ino unique per file | PASS | 0.000s | |
| statvfs: ST_RDONLY flag set on mount | PASS | 0.001s | |
| access: F_OK true for existing files | PASS | 0.000s | |
| access: R_OK true for existing files | PASS | 0.000s | |
| access: W_OK false on read-only mount | PASS | 0.000s | |
| access: F_OK false for missing file | PASS | 0.000s | |
| readdir: listdir matches backing names | PASS | 0.001s | |
| scandir: entries match listdir | PASS | 0.000s | |
| scandir: each entry is_file() and not is_dir() | PASS | 0.000s | |
| openat / fstatat: relative resolution from dirfd | PASS | 0.000s | |
| dup / dup2: independent offsets | PASS | 0.000s | |
| fcntl: F_GETFL reports O_RDONLY | PASS | 0.000s | |
| mmap: PROT_READ MAP_PRIVATE returns matching bytes | PASS | 0.068s | |
| mmap: MAP_SHARED PROT_WRITE rejected | PASS | 0.000s | |
| path: trailing slash on regular file -> ENOTDIR | PASS | 0.000s | |
| path: redundant ./// segments resolve | PASS | 0.000s | |
| chdir + relative open works | PASS | 0.000s | |
| mutate: write rejected | PASS | 0.000s | |
| mutate: unlink rejected | PASS | 0.000s | |
| mutate: rename rejected | PASS | 0.000s | |
| mutate: mkdir rejected | PASS | 0.000s | |
| mutate: symlink rejected | PASS | 0.000s | |
| mutate: link rejected | PASS | 0.000s | |
| mutate: chmod rejected | PASS | 0.000s | |
| mutate: chown rejected (only if non-root) | PASS | 0.000s | |
| mutate: utime rejected | PASS | 0.000s | |
| mutate: truncate rejected | PASS | 0.000s | |
| xattr: getxattr returns ENOTSUP/ENODATA | PASS | 0.000s | |
| xattr: setxattr rejected | PASS | 0.000s | |
| fd churn: 1000 open/close cycles, no fd leak | PASS | 0.112s |
Runner: bulk-data
| Check | Status | Duration | Detail |
|---|---|---|---|
| bulk-data:plink | PASS | 6.572s | compared 8952503 bytes (encoder total_size=8952503) |
| bulk-data:bgen | PASS | 8.742s | compared 104857600 bytes (encoder total_size=117100422) |
Runner: pjdfstest
| Check | Status | Duration | Detail |
|---|---|---|---|
| pjdfstest:open | PASS | 5.050s | ok=11 not_ok=312 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:granular | PASS | 0.054s | ok=7 not_ok=0 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:chflags | PASS | 0.101s | ok=14 not_ok=0 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:chmod | PASS | 14.177s | ok=2 not_ok=305 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:chown | PASS | 83.120s | ok=2 not_ok=1495 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:ftruncate | PASS | 4.228s | ok=3 not_ok=86 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:link | PASS | 12.898s | ok=16 not_ok=343 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:mkdir | PASS | 2.512s | ok=3 not_ok=115 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:mkfifo | PASS | 2.529s | ok=3 not_ok=117 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:mknod | PASS | 4.842s | ok=1 not_ok=185 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:rename | PASS | 36.769s | ok=6 not_ok=4851 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:rmdir | PASS | 3.546s | ok=4 not_ok=141 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:symlink | PASS | 3.271s | ok=3 not_ok=92 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:truncate | PASS | 4.206s | ok=3 not_ok=81 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:unlink | PASS | 21.233s | ok=3 not_ok=437 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
| pjdfstest:utimensat | PASS | 1.820s | ok=2 not_ok=120 timeouts=0 (read-only FS — high not_ok is expected; see log for samples) |
Runner: fio
| Check | Status | Duration | Detail |
|---|---|---|---|
| fio:seq-read | PASS | 30.217s | errors=0 io=280.2 MB runtime=30002ms throughput=9.3 MB/s |
| fio:rand-read | PASS | 60.549s | errors=0 io=20.0 MB runtime=30047ms throughput=0.7 MB/s |
| fio:mmap-read | PASS | 31.284s | errors=11 io=136.0 MB runtime=31066ms throughput=4.4 MB/s (informational) |
| fio:mmap-read:concurrent | PASS | 0.000s | records=100 fhs=17 max_overlap=24 |
| fio:parallel-seq-read | PASS | 30.706s | errors=0 io=46.8 MB runtime=30462ms throughput=1.5 MB/s |
| fio:parallel-seq-read:concurrent | PASS | 0.000s | records=376 fhs=14 max_overlap=12 |
| fio:multithread | PASS | 30.281s | errors=11 io=18.7 MB runtime=30019ms throughput=0.6 MB/s (informational) |
| fio:multithread:concurrent | PASS | 0.000s | records=382 fhs=33 max_overlap=16 |
| fio:static-stress-bim | PASS | 10.235s | errors=0 io=180.6 MB runtime=10011ms throughput=18.0 MB/s |
| fio:static-stress-fam | PASS | 10.262s | errors=0 io=290.5 MB runtime=10010ms throughput=29.0 MB/s |
Runner: fsx
| Check | Status | Duration | Detail |
|---|---|---|---|
| fsx:seed-7 | PASS | 12.073s | completed=50000/50000 mismatches=0 short_reads=0 |
| fsx:seed-23 | PASS | 8.995s | completed=50000/50000 mismatches=0 short_reads=0 |
| fsx:seed-101 | PASS | 5.641s | completed=50000/50000 mismatches=0 short_reads=0 |
Runner: stress-ng
| Check | Status | Duration | Detail |
|---|---|---|---|
| open-loop:4p:30s | PASS | 33.601s | workers=4 ops=4 errors=0 |
| open-loop:16p:30s | PASS | 30.095s | workers=16 ops=26146 errors=0 |
| stress-ng:background-load | PASS | 0.000s | rc=0 failed=None completed=None |
Runner: lifecycle
| Check | Status | Duration | Detail |
|---|---|---|---|
| lifecycle:cycles_complete | PASS | 194.055s | completed 50/50; mean=3.88s p99=5.31s max=5.31s |
| lifecycle:no_orphan_mounts | PASS | 0.000s | orphan fuse.biofuse mounts at /home/ubuntu/agents-work/sgkit-dev/biofuse/fs_tests/results/20260518T083504Z/lifecycle/mnt: 0 |
| lifecycle:max_cycle_within_budget | PASS | 0.000s | max cycle 5.31s vs budget 30.0s |
Runner: active-under-stress
| Check | Status | Duration | Detail |
|---|---|---|---|
| liveness:readdir | PASS | 0.000s | attempts=60 ok=60 timeouts=0 errors=0 max_latency=25.2ms |
| liveness:static-read:.bim | PASS | 0.000s | attempts=60 ok=60 timeouts=0 errors=0 max_latency=16.6ms |
| liveness:static-read:.fam | PASS | 0.000s | attempts=60 ok=60 timeouts=0 errors=0 max_latency=11.7ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses new feature from vcztools.