diff options
| author | Chao Yu <chao@kernel.org> | 2026-10-07 11:49:49 +0000 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2026-10-13 15:39:05 +0000 |
| commit | f32744a8b83d91f803f9fc6b9850516c0b48177f (patch) | |
| tree | b2e2a7f79d30565d71cdda858e24c4298193db8a /tools/lib/python/kdoc | |
| parent | bd09975045fb9a134135824d4ffc08109ddd79f5 (diff) | |
f2fs: introduce max_atc_write_bio_entry_cnt
Commit 3de6b8094115 ("f2fs: Run f2fs_write_end_io() asynchronously")
introduced max_atc_write_bio_size to offload write bio completion to a
workqueue when f2fs_write_end_io() is called in atomic context.
However, using the bio byte size (bi_iter.bi_size) as the threshold has
limitations once large folios or multi-page bvecs are involved:
1. In f2fs_write_end_bio(), execution time is dominated by the
completion loop (bio_for_each_folio_all() for pagecache folios,
or while(entry) for cached metadata blocks), where per-entry
locking, status clearing, sanity checks, and writeback end are
performed. The CPU latency in atomic context scales with the number
of entries in the bio, not its byte size.
2. For large folios, a large bio (e.g. 1MB comprised of single large
folios) only iterates a few times through the loop. Throttling solely
by max_atc_write_bio_size unnecessarily offloads such low-latency
bios to the workqueue, adding context-switch overhead.
3. Conversely, relying on bio->bi_vcnt is insufficient because the block
layer (bvec_try_merge_page) merges physically consecutive pages/folios
into the same bio_vec segment. Thus, a bio with bi_vcnt == 1 could
still contain multiple entries and iterate many times in end_io.
To address this, track the exact number of entries (folios or cached
blocks) queued to the write bio via entry_cnt in struct f2fs_bio, and
introduce a sysfs attribute max_atc_write_bio_entry_cnt. This enables
precise control over atomic context latency without penalizing large
folios.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc')
0 files changed, 0 insertions, 0 deletions
