Understanding alignment, object size and objects per cache for special purposes caches in the SLUB allocator.
Let's take a look a filp
, the special purpose cache for struct file
, as an example.
Note: I'm using a 5.4 kernel as that's what I had on hand (newer kernels have like struct slab overlay and stuff)
Additional edit: I've simplified things here, focusing on filp
, e.g. additional alignment on size and stuff can happen in calculate_sizes()
, typically this is just aligning the size
to word boundary (??)