[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0903301718080.25929@qirst.com>
Date: Mon, 30 Mar 2009 17:19:45 -0400 (EDT)
From: Christoph Lameter <cl@...ux.com>
To: David Rientjes <rientjes@...gle.com>
cc: Pekka Enberg <penberg@...helsinki.fi>,
Nick Piggin <nickpiggin@...oo.com.au>,
Martin Bligh <mbligh@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [patch 1/3] slub: add per-cache slab thrash ratio
On Mon, 30 Mar 2009, David Rientjes wrote:
> > > + if (oo_objects(s->oo))
> > > + thrash_ratio = s->min_free_watermark * 100 / oo_objects(s->oo);
> > > s->oo = oo_make(order, size);
> >
> > s->oo is set *after* you check it. Check oo_objects after the value has
> > been set please.
> >
>
> It's actually right the way I implemented it, oo_objects(s->oo) will be 0
> when this is called for kmem_cache_open() meaning there is no preexisting
> slab_thrash_ratio. But this check is required when calculate_sizes() is
> called from order_store() to adjust the slab_thrash_ratio for the new
> objects per slab. The above check is saving the old thrash ratio so
> the new s->min_free_watermark value can be set following the
> oo_make(). This was mentioned in the changelog for this patch:
>
> The value is stored in terms of the number of objects that the
> ratio represents, not the ratio itself. This avoids costly
> arithmetic in the slowpath for a calculation that could otherwise
> be done only when `slab_thrash_ratio' or `order' is changed.
Then its the wrong place to set it. Initializations are done in
kmem_cache_open() after calculate_sizes are called.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists