From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756833AbZCaRWl (ORCPT ); Tue, 31 Mar 2009 13:22:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756865AbZCaRWb (ORCPT ); Tue, 31 Mar 2009 13:22:31 -0400 Received: from smtp-out.google.com ([216.239.45.13]:21367 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755244AbZCaRWa (ORCPT ); Tue, 31 Mar 2009 13:22:30 -0400 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=bs6Ar/zgx7VUa2CE8oHoXOyDxTW7KMEkK1GNxHcn9Z0RRdkjwJ3nqCowcQlh0b5nJ NuGMUhjdF3Y47VSfueo4w== Date: Tue, 31 Mar 2009 10:21:42 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Christoph Lameter cc: Pekka Enberg , Nick Piggin , Martin Bligh , linux-kernel@vger.kernel.org Subject: Re: [patch 1/3] slub: add per-cache slab thrash ratio 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 Tue, 31 Mar 2009, Christoph Lameter wrote: > > @@ -3833,7 +3830,9 @@ static ssize_t order_store(struct kmem_cache *s, > > if (order > slub_max_order || order < slub_min_order) > > return -EINVAL; > > > > + thrash_ratio = s->min_free_watermark * 100 / oo_objects(s->oo); > > calculate_sizes(s, order); > > + s->min_free_watermark = oo_objects(s->oo) * thrash_ratio / 100; > > return length; > > } > > > > Hmmm.. Still calculating the trash ratio based on existing objects per > slab and then resetting the objects per slab to a different number. > Shouldnt the trash_ratio simply be zapped to an initial value if the > number of objects per slab changes? > Each cache with >= 20 objects per slab will get a default slab_thrash_ratio of 20 in v2 of the series. If the order of a cache is subsequently tuned, the default slab_thrash_ratio would be cleared without knowledge to the user. I'd agree that it should be cleared if the tunable had object units instead of a ratio, but the ratio simply applies to any given order.