From: David Laight <david.laight.linux@gmail•com>
To: Kuniyuki Iwashima <kuniyu@google•com>
Cc: dave.hansen@intel•com, alex@ghiti•fr, aou@eecs•berkeley.edu,
axboe@kernel•dk, bp@alien8•de, brauner@kernel•org,
catalin.marinas@arm•com, christophe.leroy@csgroup•eu,
dave.hansen@linux•intel.com, edumazet@google•com, hpa@zytor•com,
kuni1840@gmail•com, linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org, linux-riscv@lists•infradead.org,
linuxppc-dev@lists•ozlabs.org, maddy@linux•ibm.com,
mingo@redhat•com, mpe@ellerman•id.au, npiggin@gmail•com,
palmer@dabbelt•com, pjw@kernel•org, tglx@linutronix•de,
torvalds@linux-foundation•org, will@kernel•org, x86@kernel•org
Subject: Re: [PATCH v1 2/2] epoll: Use __user_write_access_begin() and unsafe_put_user() in epoll_put_uevent().
Date: Tue, 28 Oct 2025 09:54:07 +0000 [thread overview]
Message-ID: <20251028095407.2bb53f85@pumpkin> (raw)
In-Reply-To: <20251028053330.2391078-1-kuniyu@google.com>
On Tue, 28 Oct 2025 05:32:13 +0000
Kuniyuki Iwashima <kuniyu@google•com> wrote:
....
> I rebased on 19ab0a22efbd and tested 4 versions on
> AMD EPYC 7B12 machine:
That is zen5 which I believe has much faster clac/stac than anything else.
(It might also have a faster lfence - not sure.)
Getting a 3% change for that diff also seems unlikely.
Even if you halved the execution time of that code the system would have
to be spending 6% of the time in that loop.
Even your original post only shows 1% in ep_try_send_events().
An 'interesting' test is to replicate the code you are optimising
to see how much slower it goes - you can't gain more than the slowdown.
What is more likely is that breathing on the code changes the cache
line layout and that causes a larger performance change.
A better test for epoll_put_event would be to create 1000 fd (pipes or events).
Then time calls epoll_wait() that return lots of events.
David
next prev parent reply other threads:[~2025-10-28 9:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 0:04 [PATCH v1 0/2] epoll: Save one stac/clac pair in epoll_put_uevent() Kuniyuki Iwashima
2025-10-23 0:04 ` [PATCH v1 1/2] uaccess: Add __user_write_access_begin() Kuniyuki Iwashima
2025-10-23 5:37 ` Linus Torvalds
2025-10-23 8:29 ` David Laight
2025-10-24 5:31 ` Kuniyuki Iwashima
2025-10-23 0:04 ` [PATCH v1 2/2] epoll: Use __user_write_access_begin() and unsafe_put_user() in epoll_put_uevent() Kuniyuki Iwashima
2025-10-23 19:40 ` Dave Hansen
2025-10-24 5:16 ` Kuniyuki Iwashima
2025-10-24 14:05 ` Dave Hansen
2025-10-24 14:47 ` David Laight
2025-10-28 5:32 ` Kuniyuki Iwashima
2025-10-28 9:54 ` David Laight [this message]
2025-10-28 16:42 ` Kuniyuki Iwashima
2025-10-28 16:58 ` Linus Torvalds
2025-10-29 1:42 ` Andrew Cooper
2025-10-28 22:30 ` David Laight
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=20251028095407.2bb53f85@pumpkin \
--to=david.laight.linux@gmail$(echo .)com \
--cc=alex@ghiti$(echo .)fr \
--cc=aou@eecs$(echo .)berkeley.edu \
--cc=axboe@kernel$(echo .)dk \
--cc=bp@alien8$(echo .)de \
--cc=brauner@kernel$(echo .)org \
--cc=catalin.marinas@arm$(echo .)com \
--cc=christophe.leroy@csgroup$(echo .)eu \
--cc=dave.hansen@intel$(echo .)com \
--cc=dave.hansen@linux$(echo .)intel.com \
--cc=edumazet@google$(echo .)com \
--cc=hpa@zytor$(echo .)com \
--cc=kuni1840@gmail$(echo .)com \
--cc=kuniyu@google$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-riscv@lists$(echo .)infradead.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=maddy@linux$(echo .)ibm.com \
--cc=mingo@redhat$(echo .)com \
--cc=mpe@ellerman$(echo .)id.au \
--cc=npiggin@gmail$(echo .)com \
--cc=palmer@dabbelt$(echo .)com \
--cc=pjw@kernel$(echo .)org \
--cc=tglx@linutronix$(echo .)de \
--cc=torvalds@linux-foundation$(echo .)org \
--cc=will@kernel$(echo .)org \
--cc=x86@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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