From: Alejandro Colomar <alx@kernel.org>
To: Zeno Endemann <zeno.endemann@mailbox.org>
Cc: linux-man@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>
Subject: Re: Inaccurate description of statx(2) stx_blksize field?
Date: Wed, 22 Apr 2026 12:58:57 +0200 [thread overview]
Message-ID: <aeipj1_-xaB9Q-7y@devuan> (raw)
In-Reply-To: <c088a5a9-f415-4cd1-a12e-ca72910a9ac2@mailbox.org>
[-- Attachment #1: Type: text/plain, Size: 1207 bytes --]
[CC += Ted]
Hi,
On 2026-04-22T12:37:43+0200, Zeno Endemann wrote:
> 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?
I don't know. You should CC someone expert about file systems when
asking fs questions.
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-04-22 10:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 10:37 Inaccurate description of statx(2) stx_blksize field? Zeno Endemann
2026-04-22 10:58 ` Alejandro Colomar [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=aeipj1_-xaB9Q-7y@devuan \
--to=alx@kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=zeno.endemann@mailbox.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 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.