Re: [patch 1/2] slub: move min_partial to struct kmem_cache

From: Christoph Lameter
Date: Mon Feb 23 2009 - 11:17:47 EST


On Sun, 22 Feb 2009, David Rientjes wrote:

> +static void calculate_min_partial(struct kmem_cache *s, unsigned long min)
> +{
> + if (min < MIN_PARTIAL)
> + min = MIN_PARTIAL;
> + else if (min > MAX_PARTIAL)
> + min = MAX_PARTIAL;
> + s->min_partial = min;
> +}
> +
> /*
> * calculate_sizes() determines the order and the distribution of data within
> * a slab object.
> @@ -2319,6 +2317,11 @@ static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags,
> if (!calculate_sizes(s, -1))
> goto error;
>
> + /*
> + * 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));
> s->refcount = 1;
> #ifdef CONFIG_NUMA
> s->remote_node_defrag_ratio = 1000;
>

Move the ilog2 use into calculate_min_partial()? Otherweise
calculate_min_partial is merely enforcing limits and not doing any
calculations.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/