From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] tcp: md5 signature check scaling Date: Wed, 27 Oct 2010 08:56:03 -0700 Message-ID: <20101027085603.490e326b@nehalam> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , William.Allen.Simpson@gmail.com, Eric Dumazet , Andreas Petlund , Ilpo =?ISO-8859-1?B?SuRydmluZW4=?= , Alexey Kuznetsov , "Pekka Savola (ipv6)" , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , Herbert Xu , Gilad Ben-Yossef , Yony Amit , Zhu Yi , linux-kernel@vger.kernel.org, netdev@vger.kernel.org To: Dmitry Popov Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Wed, 27 Oct 2010 16:52:30 +0400 Dmitry Popov wrote: > From: Dmitry Popov > > TCP MD5 signature checking without socket lock. > > Each tcp_sock has 2 RCU-protected arrays (tcp[46]_md5sig_info) of > tcp[46]_md5sig_key address-key pairs. > Each key (tcp_md5sig_key) has kref struct so that there is no need to > lock the whole array to work with one key. > > MD5 functions were rewritten according to above statement and hash > check (tcp_v4_inbound_md5_hash) was moved before socket lock. > > Signed-off-by: Dmitry Popov You traded locking for ref counting which may not be as big a win as your think. Also, the overhead of RCU here might impact tests that involve lots of socket creation and destruction. --