Messages in this thread | | | Date | Tue, 8 May 2007 20:24:41 -0700 (PDT) | From | Christoph Lameter <> | 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |