From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Graf Subject: Re: [PATCH net-next 3/3] nftables: Convert nft_hash to use generic rhashtable Date: Fri, 1 Aug 2014 11:39:01 +0100 Message-ID: <20140801103901.GC7331@casper.infradead.org> References: <970429e5-2465-40f2-998b-b82dab3debe8@email.android.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netfilter-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org, paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, walpole-sKt6ljEC1JY3uPMLIKxrzw@public.gmane.org To: Patrick McHardy Return-path: Content-Disposition: inline In-Reply-To: <970429e5-2465-40f2-998b-b82dab3debe8-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-yBygre7rU0TnMu66kgdUjQ@public.gmane.org Sender: "dev" List-Id: netfilter-devel.vger.kernel.org On 08/01/14 at 11:17am, Patrick McHardy wrote: > On 1. August 2014 09:52:00 GMT+01:00, Thomas Graf wrote: > >If the set size is known in advance, the table is sized accordingly, > >otherwise the table size will default to 64. This is a slight change > >in behaviour as previously the default was 4 which eventually required > >many expansion iterations. > > That's assuming a sufficient number of entries will be added. I think there > will be many cases in nftables where the number will be lower. Since > expansion is not very expansive this number was chosen very deliberately > and I'd prefer to keep it. > > Other than that: > > Acked-by: Patrick McHardy OK, I will change the nft_hash default size back to 4. I think the expansion is more expensive than it looks though as we are potentially calling synchronize_rcu() multiple times while holding a mutex to protect from concurrent mutations.