All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chengfeng Lin <lin2530632123@gmail.com>
To: Jia Zhu <zhujia.zj@bytedance.com>
Cc: Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v3 0/2] ext4: avoid tail walks for cached large-folio writes
Date: Wed, 18 Nov 2026 17:12:32 +0800	[thread overview]
Message-ID: <20261118091232.ext4-write-t1k-prefix.3a08a@gmail.com> (raw)
In-Reply-To: <20260609035202.90669-1-zhujia.zj@bytedance.com>

Hi Jia and all,

In libMicro write_t1k, one worker overwrites a prepared ext4 file in
1 KiB buffered writes. In our v6.15.11 / v7.3 / v6.15.11 comparison,
with nine runs per endpoint, libMicro's reported time per write rose
from about 0.233 to 0.502 us (about 115%). As discussed in this series,
large folios amplify the existing buffer_head walks. The measurements
below concern the remaining prefix cost after d09811183db2 and
f10b9cc1eb20, both included in the tested v7.3 kernel.

Before each run, I created a fresh 10 MiB file on ext4 with ten buffered
1 MiB writes of zeros. Each batch seeks back to offset zero and performs
10,000 sequential overwrites; each invocation runs for 30 seconds.
The machine is an i7-12700KF, with THP=madvise. The worker was allowed on
all 20 logical CPUs, without another benchmark running.

I compared v7.3, the same kernel with ext4's maximum folio order capped
at its minimum order, and v7.3 again. Each endpoint has nine clean runs:

                                v7.3 A   min-order   v7.3 B
  Buffered write, us/1 KiB call  0.500237  0.245877    0.496312
  Observed folio size            1 MiB     4 KiB       1 MiB
  Buffers visited per walk       128.5      1          128.5
  Of those, before write range   127.5      0          127.5

The timing row averages libMicro's nine per-run medians at each
endpoint. It covers the 1 KiB buffered overwrite loop, excluding file
preparation. Maximum run-to-run CV was 0.59%; baseline drift was -0.78%.

For the traversal counts, I instrumented one separate run of the same
workload at each endpoint. I counted buffer visits in the begin and
commit walks separately for the first 1,024 writes from offset zero.
At 1 KiB per write, that covers one full 1 MiB folio on the unmodified
kernel.

The min-order control reduced the reported time per 1 KiB buffered write
by about 50.5%, or 0.25 us/call. This supports a remaining prefix-related
cost, although changing folio size also changes allocation/cache
granularity; the control is diagnostic, not a proposal to disable large
folios generally.

These counts quantify the prefix traversal that remains after the tail
fixes and may be useful for future work on this path.

The libMicro source is gormanm/libMicro at
976d502afaa2d9b919564d7fa8a08fec286dfc89. The command was:

  ./write -E -C 0 -D 30000 -B 10000 -L -S -W \
      -N write_t1k -s 1k -f /path/on/ext4/data

Thanks.

      parent reply	other threads:[~2026-11-18  9:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  3:52 [PATCH v3 0/2] ext4: avoid tail walks for cached large-folio writes Jia Zhu
2026-06-09  3:52 ` [PATCH v3 1/2] fs/buffer: avoid tail commit walk for uptodate folios Jia Zhu
2026-06-09  3:52 ` [PATCH v3 2/2] ext4: avoid tail write_begin " Jia Zhu
2026-07-23 13:08 ` [PATCH v3 0/2] ext4: avoid tail walks for cached large-folio writes Theodore Ts'o
2026-11-18  9:12 ` Chengfeng Lin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118091232.ext4-write-t1k-prefix.3a08a@gmail.com \
    --to=lin2530632123@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=willy@infradead.org \
    --cc=zhujia.zj@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.