UNION IDLE_PBN_LOCK(9)
π 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:
vdo_is_pbn_read_lock(9)vdo_downgrade_pbn_write_lock(9)vdo_claim_pbn_lock_increment(9)vdo_assign_pbn_lock_provisional_reference(9)vdo_unassign_pbn_lock_provisional_reference(9)release_pbn_lock_provisional_reference(9)struct pbn_lock_pool(9)return_pbn_lock_to_pool(9)make_pbn_lock_pool(9)free_pbn_lock_pool(9)borrow_pbn_lock_from_pool(9)initialize_zone(9)vdo_make_physical_zones(9)vdo_free_physical_zones(9)vdo_get_physical_zone_pbn_lock(9)vdo_attempt_physical_zone_pbn_lock(9)allocate_and_lock_block(9)retry_allocation(9)continue_allocating(9)vdo_allocate_block_in_zone(9)vdo_release_physical_zone_pbn_lock(9)vdo_dump_physical_zone(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms