From: Jesper Dangaard Brouer <hawk@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: "Björn Töpel" <bjorn@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"Alexei Starovoitov" <ast@kernel.org>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Eric Dumazet" <edumazet@google.com>,
"Hao Luo" <haoluo@google.com>, "Jakub Kicinski" <kuba@kernel.org>,
"Jiri Olsa" <jolsa@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Jonathan Lemon" <jonathan.lemon@gmail.com>,
"KP Singh" <kpsingh@kernel.org>,
"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Paolo Abeni" <pabeni@redhat.com>, "Song Liu" <song@kernel.org>,
"Stanislav Fomichev" <sdf@fomichev.me>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Yonghong Song" <yonghong.song@linux.dev>
Subject: Re: [PATCH net-next 3/3] net: Move flush list retrieval to where it is used.
Date: Fri, 28 Jun 2024 18:39:49 +0200 [thread overview]
Message-ID: <f565ea65-70e6-48ba-8467-355465a44a4c@kernel.org> (raw)
In-Reply-To: <20240628103020.1766241-4-bigeasy@linutronix.de>
On 28/06/2024 12.18, Sebastian Andrzej Siewior wrote:
> The bpf_net_ctx_get_.*_flush_list() are used at the top of the function.
> This means the variable is always assigned even if unused. By moving the
> function to where it is used, it is possible to delay the initialisation
> until it is unavoidable.
> Not sure how much this gains in reality but by looking at bq_enqueue()
> (in devmap.c) gcc pushes one register less to the stack. \o/.
>
> Move flush list retrieval to where it is used.
>
> Signed-off-by: Sebastian Andrzej Siewior<bigeasy@linutronix.de>
> ---
> kernel/bpf/cpumap.c | 6 ++++--
> kernel/bpf/devmap.c | 3 ++-
> net/xdp/xsk.c | 6 ++++--
> 3 files changed, 10 insertions(+), 5 deletions(-)
Nice small optimization :-)
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
next prev parent reply other threads:[~2024-06-28 16:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 10:18 [PATCH net-next 0/3] net: bpf_net_context cleanups Sebastian Andrzej Siewior
2024-06-28 10:18 ` [PATCH net-next 1/3] net: Remove task_struct::bpf_net_context init on fork Sebastian Andrzej Siewior
2024-06-28 10:18 ` [PATCH net-next 2/3] net: Optimize xdp_do_flush() with bpf_net_context infos Sebastian Andrzej Siewior
2024-06-28 10:18 ` [PATCH net-next 3/3] net: Move flush list retrieval to where it is used Sebastian Andrzej Siewior
2024-06-28 16:39 ` Jesper Dangaard Brouer [this message]
2024-06-29 1:07 ` [PATCH net-next 0/3] net: bpf_net_context cleanups Jakub Kicinski
2024-07-02 13:40 ` patchwork-bot+netdevbpf
2024-07-02 13:44 ` Sebastian Andrzej Siewior
2024-07-02 13:45 ` Sebastian Andrzej Siewior
2024-07-02 13:52 ` 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=f565ea65-70e6-48ba-8467-355465a44a4c@kernel.org \
--to=hawk@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=jonathan.lemon@gmail.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=tglx@linutronix.de \
--cc=yonghong.song@linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).