Facebook's New Linux Slab Memory Controller Saving 30~40%+ Of Memory, Less Fragmentation

Written by Michael Larabel in Linux Kernel on 9 December 2019 at 07:21 AM EST. 19 Comments
Back in September we wrote about Facebook's Roman Gushchin working on a new slab memory controller/allocator implementation that in turn could provide better memory utilization and less slab memory usage. This wasn't ready in time for the 5.5 kernel but a revised patch series was sent out last week.

Roman continues to talk up this new slab memory controller with it turning out much better than the existing slab memory code, which he says in Facebook production workloads is only seeing 45~65% slab utilization and at best case around 85%. This controller rework aims for better slab utilization and also sharing of slab pages between multiple memory cgroups. The memory accounting is done now per-object rather than per-page, among other changes.

In their testing they found when running a web front-end it used around 42% less slab memory, a database caching server used around 35% less, and a DNS server used around 36% less. In general there are 30 to 40% savings while also having other benefits like less memory fragmentation. But there is the risk of potential CPU regressions still being explored.

Those interested in this interesting Facebook kernel engineering work and what could be on the way to a stable kernel in 2020 can be found via this patch series.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week