STRUCT BUCKET(9)
π 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 (NULLif 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 π₯
- Kernel file
./drivers/md/dm-vdo/int-map.cIntroduction(9) struct int_map(9)mix(9)hash_key(9)allocate_buckets(9)vdo_int_map_create(9)vdo_int_map_free(9)vdo_int_map_size(9)dereference_hop(9)insert_in_hop_list(9)select_bucket(9)search_hop_list(9)vdo_int_map_get(9)resize_buckets(9)find_empty_bucket(9)move_empty_bucket(9)update_mapping(9)find_or_make_vacancy(9)vdo_int_map_put(9)vdo_int_map_remove(9)
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
- 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