From: David Miller <davem@davemloft.net>
To: pabeni@redhat.com
Cc: netdev@vger.kernel.org, edumazet@google.com
Subject: Re: [PATCH net-next] sock: avoid dirtying incoming_cpu if not needed
Date: Wed, 21 Jun 2017 11:44:35 -0400 (EDT) [thread overview]
Message-ID: <20170621.114435.1437675833962204147.davem@davemloft.net> (raw)
In-Reply-To: <a5af66d2a71c1fe229bbeee40db4a9aa48dd969a.1498038209.git.pabeni@redhat.com>
From: Paolo Abeni <pabeni@redhat.com>
Date: Wed, 21 Jun 2017 11:45:31 +0200
> for connected socket, the incoming_cpu field in the sock struct
> is not going to change frequently, but we are setting it
> unconditionally for each packet.
>
> Since sk_incoming_cpu and sk_flags share the same cacheline,
> and the latter is access by udp_recvmsg(), this cause a cache
> miss for each packet for UDP connected socket.
>
> With this patch, we set the incoming cpu field only when the
> ingress cpu really changes.
>
> This gives a small but measurable performance improvement for
> connected UDP socket.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Applied.
prev parent reply other threads:[~2017-06-21 16:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 9:45 [PATCH net-next] sock: avoid dirtying incoming_cpu if not needed Paolo Abeni
2017-06-21 15:44 ` David Miller [this message]
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=20170621.114435.1437675833962204147.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=edumazet@google.com \
--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 NNTP newsgroup(s).