2015-08-27 14:26:48

by Navin P.S

[permalink] [raw]
Subject: SLUB vs SLAB allocator with respect to 3.x and 4.x kernels

Hi,

I found that in many worst case scenarios like fragmention of
allocator , slub performs well than slab.
I also noticed that Centos /Ubuntu etc switched to SLUB but SLES
still uses SLAB in the default image.

Any particular reason where SLAB is the choice ?


I ask this since i find SLUB to be the default choice since 2.6.23 as
per https://en.wikipedia.org/wiki/SLUB_(software)



Regards,
Navin


2015-08-27 19:44:11

by Austin S Hemmelgarn

[permalink] [raw]
Subject: Re: SLUB vs SLAB allocator with respect to 3.x and 4.x kernels

On 2015-08-27 10:26, Navin Parakkal wrote:
> Hi,
>
> I found that in many worst case scenarios like fragmention of
> allocator , slub performs well than slab.
> I also noticed that Centos /Ubuntu etc switched to SLUB but SLES
> still uses SLAB in the default image.
>
> Any particular reason where SLAB is the choice ?
>
>
> I ask this since i find SLUB to be the default choice since 2.6.23 as
> per https://en.wikipedia.org/wiki/SLUB_(software)
>
IIRC, SLUB isn't available/reliable on some arches (that and in some
setups, the worst case scenarios are likely to never happen (for
example, a machine with 1T of RAM that get's rebooted daily isn't likely
to have significant issues with memory fragmentation)).

SLES probably hasn't switched because they're an enterprise distro,
which in turn means changing as little as possible when updating.



Attachments:
smime.p7s (2.95 kB)
S/MIME Cryptographic Signature

2015-08-27 21:06:18

by David Rientjes

[permalink] [raw]
Subject: Re: SLUB vs SLAB allocator with respect to 3.x and 4.x kernels

On Thu, 27 Aug 2015, Navin Parakkal wrote:

> Hi,
>
> I found that in many worst case scenarios like fragmention of
> allocator , slub performs well than slab.
> I also noticed that Centos /Ubuntu etc switched to SLUB but SLES
> still uses SLAB in the default image.
>
> Any particular reason where SLAB is the choice ?
>

Slab doesn't have a reliance on high-order allocations for performance
where fragmentation is a problem, it can use a smaller footprint due to
slub's per-cpu partial slabs, it is faster on some networking round-robin
benchmarks on nUMA machines, and it is has less impact when implementing
full kmem accounting for memcg.