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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]