From: David Laight <david.laight.linux@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
renpanpan <renpanpan@kylinos.cn>,
linux-kernel@vger.kernel.org, Dave Hansen <dave.hansen@intel.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 1/5] eventpoll: Convert epoll_put_uevent() to scoped user access
Date: Tue, 10 Mar 2026 10:36:40 +0000 [thread overview]
Message-ID: <20260310103640.55d45a3c@pumpkin> (raw)
In-Reply-To: <CANn89iKyGHJX8f+vm8+qXeVDKvLANMbjNqBFkjzjq3HW7KJT+A@mail.gmail.com>
On Tue, 10 Mar 2026 09:32:53 +0100
Eric Dumazet <edumazet@google.com> wrote:
> On Tue, Mar 10, 2026 at 9:29 AM Christophe Leroy (CS GROUP)
> <chleroy@kernel.org> wrote:
> >
> >
> >
> > Le 10/03/2026 à 08:54, renpanpan a écrit :
> > > [Vous ne recevez pas souvent de courriers de renpanpan@kylinos.cn. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> > >
> > > From: Eric Dumazet <edumazet@google.com>
> > >
> > > Saves two function calls, and one stac/clac pair.
> > >
> > > stac/clac is rather expensive on older cpus like Zen 2.
> > >
> > > A synthetic network stress test gives a ~1.5% increase of pps
> > > on AMD Zen 2.
> > >
> > > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > > Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
> > > Cc: Dave Hansen <dave.hansen@intel.com>
> > > Cc: Kuniyuki Iwashima <kuniyu@google.com>
> > > Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> > > ---
> > > include/linux/eventpoll.h | 11 +++++++----
> > > 1 file changed, 7 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
> > > index ccb478eb174b..ea9ca0e4172a 100644
> > > --- a/include/linux/eventpoll.h
> > > +++ b/include/linux/eventpoll.h
> > > @@ -82,11 +82,14 @@ static inline struct epoll_event __user *
> > > epoll_put_uevent(__poll_t revents, __u64 data,
> > > struct epoll_event __user *uevent)
> > > {
> > > - if (__put_user(revents, &uevent->events) ||
> > > - __put_user(data, &uevent->data))
> > > - return NULL;
> > > -
> > > + scoped_user_write_access_size(uevent, sizeof(*uevent), efault) {
> >
> > As already mentionned this could be simplified:
>
> Note the patch was already merged in Linus tree.
>
> Honestly having two different macros while we have 4 users for both
> of them seems a bit overkill to me.
>
I'm also not sure all the 'hidden size' macros really help readability.
(especially of the header file that defines them all.)
It isn't as though the source lines would get overlong - especially
if the macro name was shorter.
But now is the time to change anything - before there are too many users.
David
prev parent reply other threads:[~2026-03-10 10:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 7:54 [PATCH 1/5] eventpoll: Convert epoll_put_uevent() to scoped user access renpanpan
2026-03-10 8:28 ` Christophe Leroy (CS GROUP)
2026-03-10 8:32 ` Eric Dumazet
2026-03-10 10:25 ` Christophe Leroy (CS GROUP)
2026-03-10 14:30 ` David Laight
2026-03-10 10:36 ` David Laight [this message]
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=20260310103640.55d45a3c@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=chleroy@kernel.org \
--cc=dave.hansen@intel.com \
--cc=edumazet@google.com \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=renpanpan@kylinos.cn \
--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