From: Zeno Endemann <zeno.endemann@mailbox.org>
To: alx@kernel.org
Cc: linux-man@vger.kernel.org
Subject: Inaccurate description of statx(2) stx_blksize field?
Date: Wed, 22 Apr 2026 12:37:43 +0200 [thread overview]
Message-ID: <c088a5a9-f415-4cd1-a12e-ca72910a9ac2@mailbox.org> (raw)
Hi,
Currently, the documentation of stx_blksize in statx says:
> The "preferred" block size for efficient filesystem I/O.
> (Writing to a file in smaller chunks may cause an
> inefficient read-modify-rewrite.)
I believe this is misleading; For ext4 this field is set
to the ext4 block size, but in that context "block size"
refers to the "smallest allocation unit" (which is chosen
at file system creation time, see the mkfs.ext4 -b option)
and not the most efficient I/O size that avoids the need
for read-modify-rewrite.
At least to my understanding, to avoid such a read-modify-
rewrite you rather want to do writes in multiples of the
page size (i.e. sysconf(PAGESIZE)), since that is the unit
the page cache operates on.
While in many cases ext4 will have a block size equal to
the page size, I think it is strictly better to use the
page size directly for that purpose. Or am I mistaken?
Thanks,
Zeno Endemann
next reply other threads:[~2026-04-22 10:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 10:37 Zeno Endemann [this message]
2026-04-22 10:58 ` Inaccurate description of statx(2) stx_blksize field? Alejandro Colomar
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=c088a5a9-f415-4cd1-a12e-ca72910a9ac2@mailbox.org \
--to=zeno.endemann@mailbox.org \
--cc=alx@kernel.org \
--cc=linux-man@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox