From: Xi Ruoyao <xry111@xry111.site>
To: Mateusz Guzik <mjguzik@gmail.com>, brauner@kernel.org
Cc: viro@zeniv.linux.org.uk, jack@suse.cz,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
io-uring@vger.kernel.org, axboe@kernel.dk,
torvalds@linux-foundation.org, loongarch@lists.linux.dev
Subject: Re: [PATCH v3] vfs: support statx(..., NULL, AT_EMPTY_PATH, ...)
Date: Wed, 26 Jun 2024 11:15:47 +0800 [thread overview]
Message-ID: <6ba5b3a01715326d2a0aee11db5cbc7cb7bce59d.camel@xry111.site> (raw)
In-Reply-To: <20240625151807.620812-1-mjguzik@gmail.com>
On Tue, 2024-06-25 at 17:18 +0200, Mateusz Guzik wrote:
> The newly used helper also checks for empty ("") paths.
>
> NULL paths with any flag value other than AT_EMPTY_PATH go the usual
> route and end up with -EFAULT to retain compatibility (Rust is abusing
> calls of the sort to detect availability of statx).
>
> 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).
>
> Benchmarked with statx(..., AT_EMPTY_PATH, ...) running on Sapphire
> Rapids, with the "" path for the first two cases and NULL for the last
> one.
>
> Results in ops/s:
> stock: 4231237
> pre-check: 5944063 (+40%)
> NULL path: 6601619 (+11%/+56%)
>
> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
> ---
>
> Diffed against fs-next and assumes c050122bdbb4 ("fs: new helper
> vfs_empty_path()") from vfs.empty.path is already applied.
>
> WARNING: io_uring remains untested (modulo compilation). I presume
> Jens has a handy way of making sure things still work.
For non-io_uring part:
On LoongArch the time usage of 10000000 calls:
baseline
Glibc fstat: ./a.out 0.44s user 3.56s system 99% cpu 4.013 total
bare statx: ./a.out 0.39s user 3.54s system 99% cpu 3.927 total
patched
Glibc fstat: ./a.out 0.49s user 1.34s system 99% cpu 1.841 total
bare statx: ./a.out 0.42s user 1.32s system 99% cpu 1.748 total
statx NULL: ./a.out 0.44s user 1.29s system 99% cpu 1.734 total
Tested-by: Xi Ruoyao <xry111@xry111.site>
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2024-06-26 3:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 15:18 Mateusz Guzik
2024-06-26 2:59 ` Xi Ruoyao
2024-06-26 13:39 ` Mateusz Guzik
2024-06-26 14:35 ` Christian Brauner
2024-06-26 15:02 ` Jens Axboe
2024-06-26 3:15 ` Xi Ruoyao [this message]
2024-06-26 13:05 ` Christian Brauner
2024-09-25 14:30 ` Xi Ruoyao
2024-09-25 15:56 ` Mateusz Guzik
2024-09-26 13:02 ` 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=6ba5b3a01715326d2a0aee11db5cbc7cb7bce59d.camel@xry111.site \
--to=xry111@xry111.site \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=io-uring@vger.kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=mjguzik@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®