From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] vfs dio
Date: Mon, 20 Jan 2025 20:38:44 +0100 [thread overview]
Message-ID: <20250120-narrte-spargel-6b0f052af8b6@brauner> (raw)
In-Reply-To: <CAHk-=wj+uVo3sJU3TKup0QfftWaEXcaiH4aBqnuM09eUDdo=og@mail.gmail.com>
On Mon, Jan 20, 2025 at 11:24:56AM -0800, Linus Torvalds wrote:
> On Sat, 18 Jan 2025 at 05:09, Christian Brauner <brauner@kernel.org> wrote:
> >
> > Add a separate dio read align field to statx, as many out of place write
> > file systems can easily do reads aligned to the device sector size, but
> > require bigger alignment for writes.
>
> I've pulled this, but it needs some fixing.
>
> You added the 'dio_read_offset_align' field to 'struct kstat', and
> that structure is *critical*, because it's used even for the real
> 'stat()' calls that people actually use (as opposed to the statx side
> that is seldom a real issue).
>
> And that field was added in a way that causes the struct to grow due
> to alignment issues. For no good reason, because there were existing
> holes in there.
>
> So please just fix it.
Right, sorry I should've noticed that during review.
> I despise the whole statx thing exactly because it has (approximately)
> five specialized users, while slowing down regular stat/fstat that is
> used widely absolutely *evertwhere*.
>
> Of course, judging by past performance, I wouldn't be surprised if
> glibc has screwed the pooch, and decided to use 'statx()' to implement
> stat, together with extra pointless user space overhead to convert one
> into the other. Because that's the glibc way (ie the whole "turn
> fstat() into the much slower fstatat() call, just because").
>
> So here's the deal: 'statx()' is *not* an "improved stat". It's an
> actively worse stat() for people who need very unusual and specialized
> information, and it makes everything else worse.
Yes, I'm well aware that you dislike statx(). :) It is heavily used
nowadays though because there's a few additional bits in there that
don't require calling into filesystems but are heavily used.
I want to reiterate that if I'd been involved in statx() I would've done
it as an extensible struct. So v1 of the struct would just be exactly
what stat() was.
This way neither copy-in nor copy-out would have done any unnecessary
work and perf would've been the same. Only when userspace actually
needed additional information it would have to pass in a larger struct
and pay the price for copy-in and copy-out.
I'll get you a new PR soon!
next prev parent reply other threads:[~2025-01-20 19:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-18 13:09 [GIT PULL] vfs dio Christian Brauner
2025-01-20 19:24 ` Linus Torvalds
2025-01-20 19:38 ` Christian Brauner [this message]
2025-01-20 19:50 ` Linus Torvalds
2025-01-22 13:50 ` Christian Brauner
2025-01-20 19:39 ` Linus Torvalds
2025-01-29 6:34 ` Christoph Hellwig
2025-01-20 19:51 ` pr-tracker-bot
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=20250120-narrte-spargel-6b0f052af8b6@brauner \
--to=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).