STRUCT IRQ_AFFINITY(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… struct irq_affinity(9) โ€” like, the whole vibe

okay so bestie, welcome to the Kernel API Manual page for struct irq_affinity(9) โ€” yes that's the actual manual name, we're in the kernel docs now, main character energy only ๐Ÿซถ


โœจ NAME โœจ

struct irq_affinity โ€” the description you hand the kernel so it can do automatic irq affinity assignments for you, no cap ๐Ÿ’–


๐ŸŒธ SYNOPSIS ๐ŸŒธ

struct irq_affinity {
    unsigned int    pre_vectors;
    unsigned int    post_vectors;
    unsigned int    nr_sets;
    unsigned int    set_size[IRQ_AFFINITY_MAX_SETS];
    void (*calc_sets)(struct irq_affinity *, unsigned int nvecs);
    void *priv;
 };

like, that's the whole struct, literally copy it into your brain bestie ๐Ÿง โœจ


๐ŸŽ€ Members ๐ŸŽ€

(these are the fields, and yes every single one matters, don't skip ๐Ÿ™ˆ)

  • pre_vectors โ€” don't apply affinity to pre_vectors at the beginning of the MSI(-X) vector space. it's giving "leave the opening act alone" ๐Ÿ’…
  • post_vectors โ€” don't apply affinity to post_vectors at the end of the MSI(-X) vector space. closing act stays untouched too ๐ŸŽญ
  • nr_sets โ€” the number of interrupt sets for which affinity spreading is required. count your sets, bestie ๐Ÿ”ข
  • set_size โ€” an array holding the size of each interrupt set. every set gets its own little size slot ๐Ÿ“
  • calc_sets โ€” callback for calculating the number and size of interrupt sets. the function signature is literally void (*calc_sets)(struct irq_affinity *, unsigned int nvecs); โ€” it does the math so you don't have to ๐Ÿงฎโœจ
  • priv โ€” private data for usage by calc_sets, usually a pointer to driver/device specific data. it's your little secret stash, iykyk ๐Ÿคซ

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

go touch some of these next, they're all iconic ๐Ÿ‘‘


and that's the page bestie!! ๐Ÿ’œ it lives in ./include/linux and the version stamp says October 2026 โ€” so like, future-core of you to be reading this fr fr. slay, go set some affinities, mwah ๐ŸŽ€๐Ÿ’–๐ŸŒˆ

๐Ÿ“ฆ where this page comes from