UNION IDLE_PBN_LOCK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… union idle_pbn_lock(9)

okay bestie, welcome to the Kernel API Manual β€” yes, that manual β€” and today's main character is the page union idle_pbn_lock(9). it's giving very niche, very kernel-internals, and honestly? kinda iconic. let's get into it 🫢


✨ NAME ✨

union idle_pbn_lock β€” the PBN lock list entries, bestie. that's the whole vibe check.


🌸 SYNOPSIS 🌸

here's the glow-up, exactly as it is, no cap:

union idle_pbn_lock {
    struct list_head entry;
    struct pbn_lock lock;
 };

πŸŽ€ Members πŸŽ€

  • entry β€” literally only used while the locks are hanging out in the pool. pool era. 🏊
  • lock β€” and this one? only used while the locks are not in the pool. out-of-pool era. main character energy, off on its own. ✨

it's a union, so these two share the same memory β€” only one of them is doing anything at any given time. iykyk πŸ’…


πŸ¦‹ Description πŸ¦‹

so the unused (idle) PBN locks are kept in a list. and here's the cute part: just like in a malloc implementation, the lock structure is basically unused memory while it's sitting there doing nothing. so we can save a bit of space β€” and also not pollute the lock structure proper β€” by using a union to overlay the lock structure with the free list. 🧚

like, why waste bytes when you can just vibe-share them? literally efficient. it's giving "reuse, reduce, recycle" but for kernel memory. 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

okay the friend group is massive, here we go β€” all of these live in the Kernel file ./drivers/md/dm-vdo/physical-zone.c:


bestie fr fr, read those before you touch the union. the whole pool ecosystem is right there. πŸ”₯

and that's the page! source/version is ./drivers/md/dm-vdo, dated October 2026 β€” so mark your calendar, screenshot it, frame it, whatever. slay, bye! πŸ’–πŸŽ€πŸ’œ

πŸ“¦ where this page comes from