All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Edward Cree <ecree@solarflare.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net-next 1/4] indirect call wrappers: helpers to speed-up indirect calls of builtin
Date: Wed, 05 Dec 2018 19:03:28 +0100	[thread overview]
Message-ID: <6b8d8bc075c62adba2348fc55d8f896350ade46a.camel@redhat.com> (raw)
In-Reply-To: <06adfcdf-3535-eebc-dd32-e6d945c13825@solarflare.com>

On Tue, 2018-12-04 at 18:12 +0000, Edward Cree wrote:
> On 04/12/18 17:44, Paolo Abeni wrote:
> > On Tue, 2018-12-04 at 17:13 +0000, Edward Cree wrote:
> > > On 03/12/18 11:40, Paolo Abeni wrote:
> > > > This header define a bunch of helpers that allow avoiding the
> > > > retpoline overhead when calling builtin functions via function pointers.
> > > > It boils down to explicitly comparing the function pointers to
> > > > known builtin functions and eventually invoke directly the latter.
> > > > 
> > > > The macros defined here implement the boilerplate for the above schema
> > > > and will be used by the next patches.
> > > > 
> > > > rfc -> v1:
> > > >  - use branch prediction hint, as suggested by Eric
> > > > 
> > > > Suggested-by: Eric Dumazet <Eric Dumazet edumazet@google.com>
> > > > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> > > > ---
> > > I'm not sure I see the reason why this is done with numbers and
> > >  'name ## NR', adding extra distance between the callsite and the
> > >  list of callees.  In particular it means that each callable needs
> > >  to specify its index.
> > > Wouldn't it be simpler just to have
> > >     #define 1(f, f1, ...) \
> > >         (likely(f == f1) ? f1(__VA_ARGS__) : f(__VA_ARGS__))
> > >     #define INDIRECT_CALL_2(f, f2, f1, ...) \
> > >         (likely(f == f2) ? f2(__VA_ARGS__) : INDIRECT_CALL_1(f, f1, __VA_ARGS__))
> > > etc.?  Removing the need for INDIRECT_CALLABLE_DECLARE_* entirely.
> > Thank you for the review!
> > 
> > As some of the builtin symbols are static, we would still need some
> > macro wrappers to properly specify the scope when retpoline is enabled.
> Ah I see, it hadn't occurred to me that static callees might not be
>  available at the callsite.  Makes sense now.  In that case, have my
>  Acked-By for this patch, if you want it.

I gave a shot to your idea, and after all I think is cleaner. So I'll
send v2 with that change.

Thanks,

Paolo

  reply	other threads:[~2018-12-05 18:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 11:40 [PATCH net-next 0/4] net: mitigate retpoline overhead Paolo Abeni
2018-12-03 11:40 ` [PATCH net-next 1/4] indirect call wrappers: helpers to speed-up indirect calls of builtin Paolo Abeni
2018-12-03 18:04   ` Eric Dumazet
2018-12-04 11:27     ` Paolo Abeni
2018-12-04 16:51       ` David Miller
2018-12-04 17:13   ` Edward Cree
2018-12-04 17:44     ` Paolo Abeni
2018-12-04 18:12       ` Edward Cree
2018-12-05 18:03         ` Paolo Abeni [this message]
2018-12-03 11:40 ` [PATCH net-next 2/4] net: use indirect call wrappers at GRO network layer Paolo Abeni
2018-12-03 11:40 ` [PATCH net-next 3/4] net: use indirect call wrapper at GRO transport layer Paolo Abeni
2018-12-07  3:48   ` kbuild test robot
2018-12-03 11:40 ` [PATCH net-next 4/4] udp: use indirect call wrapper for GRO socket lookup Paolo Abeni

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=6b8d8bc075c62adba2348fc55d8f896350ade46a.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ecree@solarflare.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.