From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755844AbZBWQiS (ORCPT ); Mon, 23 Feb 2009 11:38:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752996AbZBWQh7 (ORCPT ); Mon, 23 Feb 2009 11:37:59 -0500 Received: from smtp-out.google.com ([216.239.33.17]:55866 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753073AbZBWQh6 (ORCPT ); Mon, 23 Feb 2009 11:37:58 -0500 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id: references:user-agent:mime-version:content-type:x-system-of-record; b=m5YKfrgHgaGJkc4bFc1286stnNPhC6W3u3euk/JEiE3ycH7MxaqRlFnoPv/cLog9l R6ouEhCHok+YMcU/975rw== Date: Mon, 23 Feb 2009 08:37:19 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Christoph Lameter cc: Pekka Enberg , linux-kernel@vger.kernel.org Subject: Re: [patch 1/2] slub: move min_partial to struct kmem_cach In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Feb 2009, Christoph Lameter wrote: > > The second patch in this series as a /sys/kernel/slab/cache/min_partial > > tunable that uses calculate_min_partial() to enforce a sane range, so > > while it may not actually be doing any calculations, the ilog2() is > > appropriately placed in kmem_cache_open(). We don't want to be taking the > > log of the user's min_partial value. > > Then Rename the function to set_min_partial()? > I don't have any strong opinions as to the specific name, so I'll leave this up to Pekka. set_min_partial(), to me, seems to indicate that s->min_partial will unconditionally set to the value passed, which isn't necessarily true. slub: rename calculate_min_partial() to set_min_partial() Cc: Christoph Lameter Signed-off-by: David Rientjes --- mm/slub.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c --- a/mm/slub.c +++ b/mm/slub.c @@ -2170,7 +2170,7 @@ static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags) } #endif -static void calculate_min_partial(struct kmem_cache *s, unsigned long min) +static void set_min_partial(struct kmem_cache *s, unsigned long min) { if (min < MIN_PARTIAL) min = MIN_PARTIAL; @@ -2321,7 +2321,7 @@ static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags, * The larger the object size is, the more pages we want on the partial * list to avoid pounding the page allocator excessively. */ - calculate_min_partial(s, ilog2(s->size)); + set_min_partial(s, ilog2(s->size)); s->refcount = 1; #ifdef CONFIG_NUMA s->remote_node_defrag_ratio = 1000; @@ -3854,7 +3854,7 @@ static ssize_t min_partial_store(struct kmem_cache *s, const char *buf, if (err) return err; - calculate_min_partial(s, min); + set_min_partial(s, min); return length; } SLAB_ATTR(min_partial);