lkml.org 
[lkml]   [2022]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Do we really need SLOB nowdays?
On Fri, Feb 18, 2022 at 04:10:28PM +0000, David Laight wrote:
> From: Hyeonggon Yoo
> > Sent: 18 February 2022 10:13
> ...
> > I think SLUB can be memory-efficient as SLOB.
> > Is SLOB (Address-Ordered next^Wfirst fit) stronger to fragmentation than SLUB?
>
> Dunno, but I had to patch the vxworks malloc to use 'best fit'
> because 'first fit' based on a fifo free list was really horrid.
>
> I can't imagine an address ordered 'first fit' really being that much better.
>
> There are probably a lot more allocs and frees than the kernel used to have.
>
> Also isn't the performance of a 'first fit' going to get horrid
> when there are a lot of small items on the free list.

SLOB is focused on low memory usage, at the cost of poor performance.
Its speed is not a concern.

I think Address-Ordered sequential fit method pretty well in terms of
low memory usage.

And I think SLUB may replace SLOB, but we need to sure SLUB is
absolute winner.. I wonder How slab maintainers think?

>
> Does SLUB split pages into 3s and 5s (on cache lime boundaries)
> as well as powers of 2?
>

SLUB/SLAB use different strategy than SLOB, for better allocation
performance. It's variant of segregated storage method.

SLUB/SLAB both creates dedicated "caches" for each type of object. for
example, on my system, there are slab cache for dentry(192), filp(256),
fs_cache(64) ... etc.

Objects that has different types are by default managed by different cache,
which holds manages of pages. slab caches can be merged for better cacheline
utilization.

SLUB/SLAB also creates global kmalloc caches at boot time for power of 2
objects and (128, 256, 512, 1K, 2K, 4K, 8K on my system).

Thanks,
Hyeonggon.

> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>

\
 
 \ /
  Last update: 2022-02-19 13:00    [W:0.067 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site