Conversation
@vbabka I have a quick question that came up while I was adding a new drgn helper to count the number of allocated objects in a slab cache. Let me know if I should ask on the ML instead.

What is the purpose of the slab->frozen flag, and why do frozen slabs have slab->inuse == slab->objects?
2
0
1

@osandov @vbabka FTR it will be greatly appreciated if you provide an actual answer rather than shit-posting as usual.
Cc: @ljs

1
0
0

Vlastimil Babka ๐Ÿ‡จ๐Ÿ‡ฟ๐Ÿ‡ช๐Ÿ‡บ๐Ÿ‡บ๐Ÿ‡ฆ

Edited 9 days ago

@osandov hi, frozen means some cpu has it installed as cpu slab for fastpath allocations so other cpus freeing objects to it must be more cautious and not move it to a node partial list etc. There will be inuse = objects before first such free because the freelist is detached when freezing and cpu has it on its kmem_cache_cpu. /proc/slabinfo doesn't count these cpu freelist so it's not precise. For more details these comments describe this and also cpu partial lists https://elixir.bootlin.com/linux/v6.16.4/source/mm/slub.c#L79

1
0
0

Vlastimil Babka ๐Ÿ‡จ๐Ÿ‡ฟ๐Ÿ‡ช๐Ÿ‡บ๐Ÿ‡บ๐Ÿ‡ฆ

@ptesarik @osandov @ljs hey Petr, had a bad morning or what? ;) when have I not answered such technical questions seriously before?

1
0
0

Vlastimil Babka ๐Ÿ‡จ๐Ÿ‡ฟ๐Ÿ‡ช๐Ÿ‡บ๐Ÿ‡บ๐Ÿ‡ฆ

@ptesarik @osandov @ljs oh :( sorry to hear that.

1
0
0

@vbabka @osandov @ljs Thanks, appreciated. It may get better if we engage in some shit-posting.

1
0
1

Vlastimil Babka ๐Ÿ‡จ๐Ÿ‡ฟ๐Ÿ‡ช๐Ÿ‡บ๐Ÿ‡บ๐Ÿ‡ฆ

@ptesarik @osandov @ljs also if you hail Satan!

1
1
0

AGRO TURBO.EXE SATAN ๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡จ๐Ÿ‡ฟ

@vbabka @ptesarik @osandov @ljs ๐Ÿท

oh praise the morning star

1
0
0

@lkundrak @vbabka @osandov @ljs I have tried Praise of Death by Slayer, and it also worked.
Much better now.

0
0
0
@vbabka thanks, that's super helpful! I'm embarrassed that I didn't see that comment. And that explains why /proc/slabinfo was giving me a different answer.
0
0
2