compute_fullness_hint(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… compute_fullness_hint(9) πŸ’…

okay so bestie, this one is from the Kernel API Manual, and it's literally the glow-up translator for slab free counts ✨

✨ NAME ✨

compute_fullness_hint β€” takes a slab's free block count and turns it into a "fullness hint" that can be stored in the 7 bits of a slab_summary_entry dedicated to its free count. no cap, that's the whole vibe πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

u8 compute_fullness_hint (struct slab_depot *depot , block_count_t
       free_blocks );

🌸 ARGUMENTS 🌸

  • depot β€” the depot whose summary is being updated, periodt.
  • free_blocks β€” the number of free blocks 🫢

πŸ”₯ NOTE πŸ”₯

okay so this is important, bestie: the number of free blocks must be strictly less than 2^23 blocks. even though theoretically slabs could contain precisely 2^23 blocks, there's an assumption that at least one block is used by metadata. this assumption is necessary; otherwise, the fullness hint might overflow 😭 the fullness hint formula is roughly (fullness >> 16) & 0x7f, but (2^23 >> 16) & 0x7f is 0, which would make it impossible to distinguish completely full from completely empty. iykyk πŸ’€

πŸ‘‘ RETURN πŸ‘‘

a fullness hint, which can be stored in 7 bits. that's it, that's the tea πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file is literally ./drivers/md/dm-vdo/slab-depot.c, and these are the cross-refs β€” all of them, bestie, we are not skipping a single one 🫢:


mwah πŸ’‹ this cutie is from ./drivers/md/dm-vdo, dated October 2026, and it's literally compute_fullness_hint(9). slay ✨

πŸ“¦ where this page comes from