From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754723AbcANOOO (ORCPT ); Thu, 14 Jan 2016 09:14:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754202AbcANOOL (ORCPT ); Thu, 14 Jan 2016 09:14:11 -0500 Date: Thu, 14 Jan 2016 15:14:04 +0100 From: Jesper Dangaard Brouer To: Sasha Levin Cc: brouer@redhat.com, pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, davem@davemloft.net, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: nf_conntrack: use safer way to lock all buckets Message-ID: <20160114151404.729efbd2@redhat.com> In-Reply-To: <1451960746-28915-1-git-send-email-sasha.levin@oracle.com> References: <1451960746-28915-1-git-send-email-sasha.levin@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 4 Jan 2016 21:25:46 -0500 Sasha Levin wrote: > When we need to lock all buckets in the connection hashtable we'd attempt to > lock 1024 spinlocks, which is way more preemption levels than supported by > the kernel. Furthermore, this behavior was hidden by checking if lockdep is > enabled, and if it was - use only 8 buckets(!). > > Fix this by using a global lock and synchronize all buckets on it when we > need to lock them all. This is pretty heavyweight, but is only done when we > need to resize the hashtable, and that doesn't happen often enough (or at all). > > Signed-off-by: Sasha Levin > --- Looks good to me, and I like the idea. Acked-by: Jesper Dangaard Brouer -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat Author of http://www.iptv-analyzer.org LinkedIn: http://www.linkedin.com/in/brouer