RE:(2) [PATCH v2 0/2] xfs: skip redundant fsync cache flushes
From: Daejun Park
Date: Mon Nov 16 2026 - 21:34:00 EST
On Wed, Nov 11, 2026 at 05:47:11PM +1100, Dave Chinner wrote:
> On Wed, Nov 11, 2026 at 12:17:10PM +0900, Daejun Park via B4 Relay wrote:
[...]
> > 16 fio jobs of 4k append + fsync in a QEMU guest: 1111 -> 4498
> > fsyncs/s.
Correction: fio preallocated these files by default, so they were not
appends. Real appends (--fallocate=none) on the same disk give
1311 -> 3416 fsyncs/s.
[...]
> Hence the numbers look promising for low concurrency fsync
> workloads, but I'd really like to know waht happens at the high end
> when log force count rather than per-file fsync latency is the
> performance limiting factor. I suspect that it will improve
> performance by further mitigating the number of log writes and/or
> cache flushes that need to be done, but it really needs to be
> tested....
Thanks. When flushes are expensive, v2 is faster from 128 to 512
clients but writes more log per fsync. When flushes are cheap, v2 sends
60-80% fewer flushes and changes throughput and log writes per fsync
by under 5%.
Setup: dbench 4.00 -t 30 in a QEMU guest (40 GiB) on a 990 PRO
partition, for-next 48326a2382d8 without and with v2, three runs each,
execute phase only.
1) virtio-blk cache=none, volatile write cache on, 8 vCPUs:
clients MB/s log writes/fsync max_latency ms
128 1963 -> 6886 0.10 -> 0.12 433 -> 331
256 3173 -> 6282 0.11 -> 0.38 312 -> 1956
512 4696 -> 5294 0.13 -> 0.37 468 -> 20595
1024 4466 -> 4751 0.28 -> 0.38 11128 -> 28947
2048 3973 -> 4043 0.25 -> 0.38 21153 -> 21225
2) cache=unsafe, so flushes complete without syncing, 16 vCPUs,
agcount=16: throughput -2.5% to +1.9%, log writes per fsync -4.6% to
-0.2%.
Log writes peaked at ~12,000/s (30 KiB each), below 20,000.
The long max_latency is unlink() blocked in the xfs_inodegc_queue()
throttle: from 1024 clients on base and 256 on v2 in setup 1, and from
256 on both in setup 2.
> I'd also like to know how this affects storage that does not require
> cache flushes - in those cases flushes are no-ops, so all this
> tracking and sequencing would likely be pure overhead....
No throughput or CPU overhead measured. Setup 1 with 16 vCPUs and
agcount=16, but the guest sets write_cache to "write through", so no
flushes are sent. Five runs each:
- dbench, 1/8/16/32/512 clients: MB/s changed by -0.8% to +0.8% and
guest CPU per fsync by -0.5% to +1.4%. A -3.0% at 128 clients
did not repeat in 15 more runs each (+0.1%).
- fs_mark, 16 threads: create and unlink of 12.8M empty files and
fsync of 640k 4 KiB files changed time by -0.5% to -0.1% and guest
CPU by -1.6% to +0.6%. chown -R times (13-108 s) varied too much to
compare.
Best regards,
Daejun