MPTCP Archive mirror
 help / color / mirror / Atom feed
From: Jason Xing <kerneljasonxing@gmail.com>
To: Paolo Abeni <pabeni@redhat.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, 5 Apr 2024 17:11:05 +0800	[thread overview]
Message-ID: <CAL+tcoBFS9Z-=H5g8hoyDVuvcmT+wEuAdT6GxyS-vh0hKdE8cw@mail.gmail.com> (raw)
In-Reply-To: <6b77ce4f71dae82a0be793cf17fac4fda0884501.camel@redhat.com>

Hello Paolo,

On Fri, Apr 5, 2024 at 4:34 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> 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.

Interesting. Thanks for the explanation:)

>
> 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!)

I'll drop this patch.

Thanks,
Jason

>
> Cheers,
>
> Paolo
>

  reply	other threads:[~2024-04-05  9:11 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
2024-04-05  9:11         ` Jason Xing [this message]
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='CAL+tcoBFS9Z-=H5g8hoyDVuvcmT+wEuAdT6GxyS-vh0hKdE8cw@mail.gmail.com' \
    --to=kerneljasonxing@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=geliang@kernel.org \
    --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 \
    --cc=pabeni@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).