Question about freeing of empty per-CPU partial slabs in SLUB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vlastimil (and other SLUB maintainers),

I have a question about freeing of empty per-CPU partial slabs in the
SLUB allocator.

The "Linux SLUB Allocator Internals and Debugging" article [1] states:

"If the partial slab becomes an empty slab after freeing up the
object, it will be left in its current list if the number of partial
slabs for the concerned node is within the limits (i.e < slab cache’s
min_partial). This applies to both slabs belonging to a per-cpu
partial slab list and slabs belonging to a per-node partial slab list.
If the number of partial slabs are outside the limit (i.e >= slab
cache’s min partial) then the newly available empty slab is freed and
is removed from the corresponding partial slab list."

The part that seems wrong to me here is the statement that this
applies to the per-CPU partial list. Based on the code in __slab_free,
it looks like it cannot reach the slab_empty label for a slab that is
on the per-CPU partial list.

(I know that an empty per-CPU partial slab can be freed when the list
overflows or via shrinking, the question is about the slab being freed
directly by __slab_free.)

Is the article wrong with regards to this case? Or did this behavior
change recently (I failed found any traces of this)?

Other than this statement, the article seems to be correct about all
other small details that I looked into, so I'm not sure whether my
understanding of the code is wrong of the article is.

I hope you could clarify this.

Thank you!

[1] https://blogs.oracle.com/linux/post/linux-slub-allocator-internals-and-debugging-1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux