public inbox for [email protected]
 help / color / mirror / Atom feed
From: Huacai Chen <[email protected]>
To: Xi Ruoyao <[email protected]>, Arnd Bergmann <[email protected]>
Cc: Mateusz Guzik <[email protected]>,
	[email protected], [email protected],  [email protected],
	[email protected], [email protected],
	 [email protected], [email protected],
	[email protected],  [email protected]
Subject: Re: [PATCH 2/2] vfs: support statx(..., NULL, AT_EMPTY_PATH, ...)
Date: Sun, 30 Jun 2024 21:18:26 +0800	[thread overview]
Message-ID: <CAAhV-H4XZCb_Yr=5yONmPKuCywGEP0Ncqjy9WEeQqzU31ssMhQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>

On Sun, Jun 30, 2024 at 10:40 AM Xi Ruoyao <[email protected]> wrote:
>
> On Sun, 2024-06-30 at 09:40 +0800, Huacai Chen wrote:
> > On Tue, Jun 25, 2024 at 11:00 PM Xi Ruoyao <[email protected]> wrote:
> > >
> > > On Tue, 2024-06-25 at 22:09 +0800, Huacai Chen wrote:
> > > > On Tue, Jun 25, 2024 at 7:01 PM Mateusz Guzik <[email protected]>
> > > > wrote:
> > > > >
> > > > > The newly used helper also checks for 0-sized buffers.
> > > > >
> > > > > This avoids path lookup code, lockref management, memory
> > > > > allocation
> > > > > and
> > > > > in case of NULL path userspace memory access (which can be quite
> > > > > expensive with SMAP on x86_64).
> > > > >
> > > > > statx with AT_EMPTY_PATH paired with "" or NULL argument as
> > > > > appropriate
> > > > > issued on Sapphire Rapids (ops/s):
> > > > > stock:     4231237
> > > > > 0-check:   5944063 (+40%)
> > > > > NULL path: 6601619 (+11%/+56%)
> > > > >
> > > > > Signed-off-by: Mateusz Guzik <[email protected]>
> > > > Hi, Ruoyao,
> > > >
> > > > I'm a bit confused. Ii this patch a replacement of your recent
> > > > patch?
> > >
> > > Yes, both Linus and Christian hates introducing a new AT_ flag for
> > > this.
> > >
> > > This patch just makes statx(fd, NULL, AT_EMPTY_PATH, ...) behave
> > > like
> > > statx(fd, "", AT_EMPTY_PATH, ...) instead.  NULL avoids the
> > > performance
> > > issue and it's also audit-able by seccomp BPF.
> > To be honest, I still want to restore __ARCH_WANT_NEW_STAT. Because
> > even if statx() becomes audit-able, it is still blacklisted now.
>
> Then patch the sandbox to allow it.
>
> The sandbox **must** be patched anyway or it'll be broken on all 32-bit
> systems after 2037.  [Unless they'll unsupport all 32-bit systems before
> 2037.]
Yes, but it will not happen immediately.

>
> > Restoring __ARCH_WANT_NEW_STAT is a very small change that doesn't
> > introduce any complexity, but it makes life easier. And I think libLoL
> > also likes __ARCH_WANT_NEW_STAT, though it isn't an upstream
> > project...
>
> At least you should not restore it for 32-bit.  libLoL also has nothing
> to do with 32-bit systems anyway.  Maybe conditional it with a #if
> checking __BITS_PER_LONG.
Agree, but currently LoongArch only support 64bit, so we don't need
#ifdef now (Many Kconfig options also need to depend on 64bit, but
dependencies are removed when LoongArch get upstream).

>
> And the vendors should really port their software to the upstreamed ABI
> instead of relying on liblol.  <rant>Is a recompiling so difficult, or
> are the programmers so stupid to invoke plenty of low-level syscalls
> directly (bypassing Glibc) in their code?</rant>
Unfortunately, libLoL may exist for a very long time. Recompiling
isn't difficult, the real problem is "I have already ported to
LoongArch, why should I port again?".

Huacai

>
> --
> Xi Ruoyao <[email protected]>
> School of Aerospace Science and Technology, Xidian University
>

  reply	other threads:[~2024-06-30 13:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 11:00 [PATCH 0/2] statx NULL path support Mateusz Guzik
2024-06-25 11:00 ` [PATCH 1/2] vfs: add CLASS fd_raw Mateusz Guzik
2024-06-25 12:22   ` Xi Ruoyao
2024-06-25 13:13     ` Mateusz Guzik
2024-06-25 11:00 ` [PATCH 2/2] vfs: support statx(..., NULL, AT_EMPTY_PATH, ...) Mateusz Guzik
2024-06-25 13:24   ` Xi Ruoyao
2024-06-25 13:28     ` Xi Ruoyao
2024-06-25 13:28     ` Mateusz Guzik
2024-06-25 14:09   ` Huacai Chen
2024-06-25 14:58     ` Xi Ruoyao
2024-06-30  1:40       ` Huacai Chen
2024-06-30  2:39         ` Xi Ruoyao
2024-06-30 13:18           ` Huacai Chen [this message]
2024-07-01 11:59           ` Arnd Bergmann
2024-07-02 15:36             ` Huacai Chen
2024-07-02 17:06               ` Arnd Bergmann
2024-07-03  4:30                 ` Huacai Chen
2024-07-03  8:45                 ` Christian Brauner
2024-07-03  9:35                   ` Huacai Chen
2024-07-03 10:07                     ` Xi Ruoyao
2024-07-03 16:31                   ` Linus Torvalds
2024-07-03 16:54                     ` Xi Ruoyao
2024-07-03 17:09                       ` Linus Torvalds
2024-07-03 17:30                         ` Xi Ruoyao
2024-07-03 17:40                           ` Linus Torvalds
2024-07-03 17:54                             ` Linus Torvalds
2024-07-03 18:14                               ` Christian Brauner
2024-07-03 18:39                                 ` Christian Brauner
2024-07-03 19:00                                 ` Linus Torvalds
2024-07-03 19:18                                   ` Linus Torvalds
2024-07-03 18:48                               ` Xi Ruoyao
2024-07-03 19:05                                 ` Linus Torvalds
2024-07-03 19:33                                   ` Christian Brauner
2024-07-03 19:52                                     ` Linus Torvalds
2024-07-03 18:44                             ` Arnd Bergmann
2024-07-03 19:55                               ` Christian Brauner
2024-07-03 17:11                       ` Xi Ruoyao
2024-07-04  2:38                       ` Huacai Chen
2024-07-04  3:23                         ` Xi Ruoyao
2024-07-04  4:14                           ` Xi Ruoyao
2024-07-04  5:55                       ` Florian Weimer
2024-07-04  6:02                         ` Xi Ruoyao
2024-07-01  4:38 ` [PATCH 0/2] statx NULL path support Christoph Hellwig
2024-07-01  6:46   ` Xi Ruoyao

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='CAAhV-H4XZCb_Yr=5yONmPKuCywGEP0Ncqjy9WEeQqzU31ssMhQ@mail.gmail.com' \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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