lkml.org 
[lkml]   [2006]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 9/9] slab - Implement single mempool backing for slab allocator
Hi,

On 1/25/06, Matthew Dobson <colpatch@us.ibm.com> wrote:
> -static void *kmem_getpages(kmem_cache_t *cachep, gfp_t flags, int nodeid)
> +static void *kmem_getpages(kmem_cache_t *cachep, gfp_t flags, int nodeid,
> + mempool_t *pool)
> {
> struct page *page;
> void *addr;
> int i;
>
> flags |= cachep->gfpflags;
> - page = alloc_pages_node(nodeid, flags, cachep->gfporder);
> + /*
> + * If this allocation request isn't backed by a memory pool, or if that
> + * memory pool's gfporder is not the same as the cache's gfporder, fall
> + * back to alloc_pages_node().
> + */
> + if (!pool || cachep->gfporder != (int)pool->pool_data)
> + page = alloc_pages_node(nodeid, flags, cachep->gfporder);
> + else
> + page = mempool_alloc_node(pool, flags, nodeid);

You're not returning any pages to the pool, so the it will run out
pages at some point, no? Also, there's no guarantee the slab allocator
will give back the critical page any time soon either because it will
use it for non-critical allocations as well as soon as it becomes part
of the object cache slab lists.

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

\
 
 \ /
  Last update: 2006-01-26 09:13    [from the cache]
©2003-2011 Jasper Spaans