[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <463B7F63.8070508@cs.helsinki.fi>
Date: Fri, 04 May 2007 21:45:55 +0300
From: Pekka Enberg <penberg@...helsinki.fi>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC: Christoph Lameter <clameter@....com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, netdev@...r.kernel.org,
Trond Myklebust <trond.myklebust@....uio.no>,
Thomas Graf <tgraf@...g.ch>,
David Miller <davem@...emloft.net>,
James Bottomley <James.Bottomley@...elEye.com>,
Mike Christie <michaelc@...wisc.edu>,
Andrew Morton <akpm@...ux-foundation.org>,
Daniel Phillips <phillips@...gle.com>
Subject: Re: [PATCH 08/40] mm: kmem_cache_objsize
On Fri, 2007-05-04 at 11:30 -0700, Christoph Lameter wrote:
> > Hmmm... Maybe lets have
> >
> > unsigned kmem_estimate_pages(struct kmem_cache *slab_cache, int objects)
> >
> > which would calculate the worst case memory scenario for allocation the
> > number of indicated objects?
On Fri, 4 May 2007, Peter Zijlstra wrote:
> Perfectly fine with me, Pekka, any objections?
Again, slab has no way of actually estimating how many pages you need
for a given number of objects. So we end up calculating some upper bound
which doesn't belong in mm/slab.c. I am perfectly okay with:
(1) kmem_nr_bytes_per_object which is what Peter has now
or alternatively,
(2) kmem_nr_objects_per_page which I think Christoph suggested
Both of them, the slab knows the answer, and doesn't need to guess. It's
up to the caller to figure out what the acceptable upper bound is.
Pekka
-
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