linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Question about freeing of empty per-CPU partial slabs in SLUB
@ 2024-09-10 16:38 Andrey Konovalov
  2024-09-12  8:34 ` Vlastimil Babka
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Konovalov @ 2024-09-10 16:38 UTC (permalink / raw)
  To: Vlastimil Babka; +Cc: Linux Memory Management List, LKML

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-13 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-10 16:38 Question about freeing of empty per-CPU partial slabs in SLUB Andrey Konovalov
2024-09-12  8:34 ` Vlastimil Babka
2024-09-13 13:27   ` Andrey Konovalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox