[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6b77ce4f71dae82a0be793cf17fac4fda0884501.camel@redhat.com>
Date: Fri, 05 Apr 2024 10:34:30 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Jason Xing <kerneljasonxing@...il.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
matttbe@...nel.org, martineau@...nel.org, geliang@...nel.org,
mptcp@...ts.linux.dev, netdev@...r.kernel.org, Jason Xing
<kernelxing@...cent.com>
Subject: Re: [PATCH net-next 1/2] mptcp: don't need to check SKB_EXT_MPTCP
in mptcp_reset_option()
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@...hat.com> wrote:
> >
> > On Fri, 2024-04-05 at 10:39 +0800, Jason Xing wrote:
> > > From: Jason Xing <kernelxing@...cent.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
Powered by blists - more mailing lists