From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932636AbYCFOmS (ORCPT ); Thu, 6 Mar 2008 09:42:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759972AbYCFOmD (ORCPT ); Thu, 6 Mar 2008 09:42:03 -0500 Received: from courier.cs.helsinki.fi ([128.214.9.1]:38824 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758418AbYCFOmA (ORCPT ); Thu, 6 Mar 2008 09:42:00 -0500 Date: Thu, 6 Mar 2008 16:41:58 +0200 (EET) From: Pekka J Enberg To: Patrick McHardy cc: Netfilter Development Mailinglist , clameter@sgi.com, joe@perches.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] netfilter: replace horrible hack with ksize() In-Reply-To: <47D0014D.1060901@trash.net> Message-ID: References: <47CFF9B7.5060803@trash.net> <47D0014D.1060901@trash.net> 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 Thu, 6 Mar 2008, Patrick McHardy wrote: > It decides to reallocate when the remaining space isn't enough > to hold the new data. NF_CT_EXT_MIN_SIZE is used to make sure it > doesn't allocate anything smaller than the minimum slab size and > hopefully avoid reallocations in the future. Unless I'm > misunderstanding what ksize() does, the easiest way to get > rid of this would be to replace NF_CT_EXT_MIN_SIZE by ksize(0). I think you are misunderstanding ksize() (see mm/slub.c::ksize() for example). Furthermore, I think your current reallocation code is broken too as explained in a previous mail and my patch fixes that to behave as krealloc() does. Pekka