Linux filesystem development
 help / color / mirror / Atom feed
From: Zeno Endemann <zeno.endemann@mailbox.org>
To: linux-fsdevel@vger.kernel.org
Subject: Meaning of struct statx->stx_blksize field
Date: Mon, 27 Apr 2026 12:41:16 +0200	[thread overview]
Message-ID: <9a7ffc95-077c-473d-9462-a7d4ac58e9ed@mailbox.org> (raw)

Hi,

The man page of statx(2) describes the stx_blksize like so:

 > The "preferred" block size for efficient filesystem I/O.
 > (Writing to a file in smaller chunks may cause an
 > inefficient read-modify-rewrite.)


However, from observation it rather looks like that field
is set to the "block size" (meaning the allocation unit) of
the file system the given file resides on - at least for
ext4 and vfat.

To my understanding that value is fairly unrelated to a good
IO transfer size and for the most part not really relevant
for userspace apps. For avoiding inefficient read-modify
rewrite the actual relevant thing is writing in multiples of
the page size (unless the page cache is bypassed, in which
case I guess stx_dio_offset_align is the value to use).

Can someone confirm my interpretation, so the man page can be
corrected? Or do I misunderstand or overlook something?

Thanks,

Zeno Endemann

             reply	other threads:[~2026-04-27 10:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 10:41 Zeno Endemann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-03 12:41 Meaning of struct statx->stx_blksize field Andreas Dilger
2026-05-03 13:53 ` Zeno Endemann

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=9a7ffc95-077c-473d-9462-a7d4ac58e9ed@mailbox.org \
    --to=zeno.endemann@mailbox.org \
    --cc=linux-fsdevel@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