[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0705082021420.22016@schroedinger.engr.sgi.com>
Date: Tue, 8 May 2007 20:24:41 -0700 (PDT)
From: Christoph Lameter <clameter@....com>
To: Matt Mackall <mpm@...enic.com>
cc: akpm@...ux-foundation.org, Nick Piggin <nickpiggin@...oo.com.au>,
David Miller <davem@...emloft.net>,
linux-kernel@...r.kernel.org
Subject: Re: + fix-spellings-of-slab-allocator-section-in-init-kconfig.patch
added to -mm tree
On Tue, 8 May 2007, Matt Mackall wrote:
> > Exactly. That overhead does not exist in SLUB. Thus SLOB is less efficient
> > than SLUB.
>
> What size object does kmalloc(80) return? In SLAB, the answer is 128
> bytes with 48 bytes of slack space. In SLOB, the answer is 88 for 8
> bytes of slack space. Looks like SLUB is in the same camp as SLAB
> here:
There is a 96 sized general slab. So it would go up to that size. But you
can create a 80 byte slab of course. And that may cost minimal overhead
since 80 byte slabs may be merged. If one already exist then you get it
for free.
> +/*
> + * We keep the general caches in an array of slab caches that are used for
> + * 2^x bytes of allocations.
> + */
> +extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
> ..
> + if (size <= 128) return 7;
96 please. You skipped the first part.
> SLOB's kmalloc overhead is 8 bytes, always. That's 1/8th the average
> SLAB kmalloc overhead.
SLUB can generate an 80 byte slab with minimal overhead if you wanted. But
yes I agree the flexbility there is an advantage if you have objects of
various sizes.
-
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