[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0701041042020.21800@schroedinger.engr.sgi.com>
Date: Thu, 4 Jan 2007 10:43:09 -0800 (PST)
From: Christoph Lameter <clameter@....com>
To: Pekka Enberg <penberg@...helsinki.fi>
cc: Hugh Dickins <hugh@...itas.com>, Andrew Morton <akpm@...l.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fix BUG_ON(!PageSlab) from fallback_alloc
On Thu, 4 Jan 2007, Pekka Enberg wrote:
> So, how about we rename the current cache_grow() to __cache_grow() and
> move the kmem_freepages() to a higher level function like this:
>
> static int cache_grow(struct kmem_cache *cache,
> gfp_t flags, int nodeid)
> {
> void *objp;
> int ret;
>
> if (flags & __GFP_NO_GROW)
> return 0;
>
> objp = kmem_getpages(cachep, flags, nodeid);
> if (!objp)
> return 0;
>
> ret = __cache_grow(cache, flags, nodeid, objp);
> if (!ret)
> kmem_freepages(cachep, objp);
>
> return ret;
> }
>
> And use the non-allocating __cache_grow version() in fallback_alloc() instead?
Good idea if you can make it so that it is clean. There is some
additional processing in cache_grow() that would have to be taken into
account.
-
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