STRUCT BUCKET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct bucket β€” hash bucket. That's the whole name, bestie. This is from the Kernel API Manual, page struct bucket(9), and it's lowkey iconic.

πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the struct in all its glory, exactly as it appears:

       struct bucket {
           u8 first_hop;
           u8 next_hop;
           u64 key;
           void *value;
        };

πŸ’… Members πŸ’…

  • first_hop β€” the biased offset of the first entry in the hop list of the neighborhood that hashes to this bucket.
  • next_hop β€” the biased offset of the next bucket in the hop list.
  • key β€” the key stored in this bucket.
  • value β€” the value stored in this bucket (NULL if empty).

🌸 Description 🌸

Okay so picture this: buckets are packed together to reduce memory usage and improve cache efficiency. It would be tempting to encode the hop offsets separately and maintain alignment of key/value pairs β€” like, sure, Jan β€” but it's crucial to keep the hop fields near the buckets that use them so they'll tend to share cache lines. That's the whole point, and honestly? It ate.

πŸ”₯ SEE ALSO πŸ”₯


That's the tea. This page's source/version line is ./drivers/md/dm-vdo, and it's dated October 2026. struct bucket(9) out β€” mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from