LOCK COUNTERS.(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… Lock Counters. πŸ’…

okay bestie, welcome to Lock Counters.(9) in the Kernel API Manual β€” this one is short and honestly kinda chic. A lock_counter is intended to keep all of the locks for the blocks in the recovery journal. That's the whole assignment. πŸ’–

All the per-zone counters are kept in a single array, and that array is arranged by zone β€” i.e. zone 0's lock 0 is at index 0, zone 0's lock 1 is at index 1, and zone 1's lock 0 is at index 'locks'. The way this arrangement is set up is intended to minimize cache-line contention for counters from different zones. lowkey iconic layout behavior. ✨

The locks are implemented as a single object instead of as a lock counter per lock. Why? two reasons, both valid: it affords this opportunity to reduce cache line contention, and it also eliminates the need to have a completion per lock. no extra completion per lock, we love that for us. πŸŽ€

Lock sets are laid out with the set for recovery journal first, followed by the logical zones, and then the physical zones. that's the order, periodt. πŸ¦‹

🌸 SEE ALSO 🌸

Kernel file: ./drivers/md/dm-vdo/recovery-journal.c β€” yes, that exact cutie. 🫢

The whole related-pages squad is literally:

mwah πŸ’‹ β€” this page comes from ./drivers/md/dm-vdo, dated October 2026, and it's literally Lock Counters.(9). bye bestie, go slay those locks πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from