Re: [PATCH v4 06/22] slab: add sheaves to most caches

Zhao Liu
2026-01-30T06:50:16Z

Hi Vlastimil,

> > vm_area_cachep's capacity seems to be adjusted to 60 and
> > maple_node_cache keeps 32 as the args setting.
>
> Good to know. It is a bit larger.
> Hm I could have probably applied the args capacity before doing the roundup
> to make sheaf fill whole kmalloc size. Would add a few object for maple node
> I guess.

Re-considerring this formula:

the nr_objects in set_cpu_partial() in fact represents the half-full
case since it was used to calculate nr_slabs in slub_set_cpu_partial().

Therefore, the maximum capacity of this partial approach should be
nr_objects * 2 (and should actually be even larger, since it doesn't
account for the object on CPU's freelist).

But here, for sheaf, the implicit assumption is that it is completely
full, so that for the maximum capacity of objects per CPU, the sheaf
approach is "half" that of the partial approach.

Is this expected? I'm considering whether we should remove the
“divide by two” and instead calculate the sheaf capacity based on
half-full assumption (e.h., full main & empty spare).

Thanks,
Zhao