Queueing is outside of SLUB nowdays

From: Hyeonggon Yoo
Date: Thu Sep 30 2021 - 20:39:16 EST


On Mon, Sep 27, 2021 at 07:03:19PM +0200, Vlastimil Babka wrote:
> On 9/27/21 11:03, Hyeonggon Yoo wrote:
> > Hello there,
> >
> > I've been working on adding 'lockless cache' on sl[au]b for a while.
> > But what it actually does is actually adding 'queuing' on slub.
>
> Yeah, I pointed out those threads from 2011 that called it exactly that...
> was there any conclusion why that was not ultimately merged?

Looking at other layers, they implemented queuing layer outside of SLUB.
See commit 795bb1c00dd ("net: bulk free infrastructure for NAPI context,
use napi_consume_skb") for example. They made skb cache because SLUB is
not suitable for intensive alloc/free.

And because the queue is outside of slab, it can go lockless
depending on it's context. (But it's not easy to do so in slab because
slab is general purpose allocator.)

So current approach on place where slab's performance is critical
is implementing queuing layer on top of slab.

Then new question arising:
- Is that proper way to solve fundamental problem?
- why not use SLAB if they need queuing?
- how does this approach work on SLAB?

- If there are no problems with queuing outside of slab, why does
SLAB exist? can we just drop SLAB?

I think we need to think about questions above.