From: David Miller <davem@davemloft.net>
To: pabeni@redhat.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] sock: avoid dirtying sk_stamp, if possible
Date: Thu, 30 Mar 2017 20:29:24 -0700 (PDT) [thread overview]
Message-ID: <20170330.202924.1023519735753552178.davem@davemloft.net> (raw)
In-Reply-To: <f29d595f4a72d77730447be2a7c5f243fad47751.1490875313.git.pabeni@redhat.com>
From: Paolo Abeni <pabeni@redhat.com>
Date: Thu, 30 Mar 2017 14:03:06 +0200
> sock_recv_ts_and_drops() unconditionally set sk->sk_stamp for
> every packet, even if the SOCK_TIMESTAMP flag is not set in the
> related socket.
> If selinux is enabled, this cause a cache miss for every packet
> since sk->sk_stamp and sk->sk_security share the same cacheline.
> With this change sk_stamp is set only if the SOCK_TIMESTAMP
> flag is set, and is cleared for the first packet, so that the user
> perceived behavior is unchanged.
>
> This gives up to 5% speed-up under udp-flood with small packets.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Applied, thanks.
next prev parent reply other threads:[~2017-03-31 3:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-30 12:03 [PATCH net-next] sock: avoid dirtying sk_stamp, if possible Paolo Abeni
2017-03-30 13:52 ` Eric Dumazet
2017-03-30 14:23 ` Paolo Abeni
2017-03-30 15:37 ` Eric Dumazet
2017-03-31 3:29 ` David Miller [this message]
2017-03-31 21:59 ` [PATCH net-next] sock: correctly test SOCK_TIMESTAMP in sock_recv_ts_and_drops() Eric Dumazet
2017-03-31 23:36 ` Paolo Abeni
2017-04-03 2:35 ` David Miller
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=20170330.202924.1023519735753552178.davem@davemloft.net \
--to=davem@davemloft.net \
--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).