From: Paolo Abeni <pabeni@redhat.com>
To: Jason Xing <kerneljasonxing@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org,
mptcp@lists.linux.dev, netdev@vger.kernel.org,
Jason Xing <kernelxing@tencent.com>
Subject: Re: [PATCH net-next 1/2] mptcp: don't need to check SKB_EXT_MPTCP in mptcp_reset_option()
Date: Fri, 05 Apr 2024 10:34:30 +0200 [thread overview]
Message-ID: <6b77ce4f71dae82a0be793cf17fac4fda0884501.camel@redhat.com> (raw)
In-Reply-To: <CAL+tcoBEkK-ncB6zdJrq7kkd3MEdyT7_ONOyB=0cVVR_oj-4yA@mail.gmail.com>
On Fri, 2024-04-05 at 15:58 +0800, Jason Xing wrote:
> Hello Paolo,
>
> On Fri, Apr 5, 2024 at 3:47 PM Paolo Abeni <pabeni@redhat.com> wrote:
> >
> > On Fri, 2024-04-05 at 10:39 +0800, Jason Xing wrote:
> > > From: Jason Xing <kernelxing@tencent.com>
> > >
> > > Before this, what mptcp_reset_option() checks is totally the same as
> > > mptcp_get_ext() does, so we could skip it.
> >
> > Note that the somewhat duplicate test is (a possibly not great)
> > optimization to avoid jumping in the mptcp code (possible icache
> > misses) for plain TCP sockets.
> >
> > I guess we want to maintain it.
>
> Okay, I just read code and found the duplication but may I ask why it
> has something to do with icache misses?
The first check/mptcp_get_ext() is in mptcp_reset_option() /
tcp_v4_send_reset(). For plain TCP socket it will fail and the
execution will continue inside the same compilation unit. The code
locality should avoid icaches misses around there.
Removing such check, even when processing plain TCP packets, the code
execution will have to call into mptcp_get_reset_option() in the mptcp
code, decreasing the code locality and increasing the chance of icache
misses.
I don't have actual profile data, so this is an early optimization (and
thus root of all evil), but sounds reasonable to me (yep, I'm biased!)
Cheers,
Paolo
next prev parent reply other threads:[~2024-04-05 8:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 2:39 [PATCH net-next 0/2] mptcp: add reset reasons in skb in more cases Jason Xing
2024-04-05 2:39 ` [PATCH net-next 1/2] mptcp: don't need to check SKB_EXT_MPTCP in mptcp_reset_option() Jason Xing
2024-04-05 7:47 ` Paolo Abeni
2024-04-05 7:58 ` Jason Xing
2024-04-05 8:34 ` Paolo Abeni [this message]
2024-04-05 9:11 ` Jason Xing
2024-04-05 2:39 ` [PATCH net-next 2/2] mptcp: add reset reason options in some places Jason Xing
2024-04-05 8:16 ` Paolo Abeni
2024-04-05 9:09 ` Jason Xing
2024-04-05 3:27 ` [PATCH net-next 0/2] mptcp: add reset reasons in skb in more cases MPTCP CI
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=6b77ce4f71dae82a0be793cf17fac4fda0884501.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geliang@kernel.org \
--cc=kerneljasonxing@gmail.com \
--cc=kernelxing@tencent.com \
--cc=kuba@kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox