From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] sock: avoid dirtying sk_stamp, if possible Date: Thu, 30 Mar 2017 20:29:24 -0700 (PDT) Message-ID: <20170330.202924.1023519735753552178.davem@davemloft.net> References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: pabeni@redhat.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:38302 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753900AbdCaD32 (ORCPT ); Thu, 30 Mar 2017 23:29:28 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Paolo Abeni 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 Applied, thanks.