request_percpu_irq_affinity(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– request_percpu_irq_affinity(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” today's main character is request_percpu_irq_affinity(9), and she is literally here to allocate a percpu interrupt line. mouthful of a name? yes. iconic? also yes. let's get into it. ✨


🌸 NAME 🌸

request_percpu_irq_affinity β€” allocate a percpu interrupt line. that's the vibe, no cap. πŸ’…


✨ SYNOPSIS ✨

here's the signature, copied exactly so nobody gets creative with it:

       int request_percpu_irq_affinity (unsigned int irq , irq_handler_t
       handler , const char *devname , const cpumask_t *affinity , void
       __percpu *dev_id );

πŸŽ€ ARGUMENTS πŸŽ€

the cast, in order β€” no skips, bestie:

  • irq β€” Interrupt line to allocate.
  • handler β€” Function to be called when the IRQ occurs.
  • devname β€” An ascii name for the claiming device.
  • affinity β€” A cpumask describing the target CPUs for this interrupt.
  • dev_id β€” A percpu cookie passed back to the handler function.

πŸ’… DESCRIPTION πŸ’…

so here's the key tea: this call allocates interrupt resources, but it doesn't enable the interrupt on any CPU, because all percpu-devid interrupts are flagged with IRQ_NOAUTOEN. so don't just sit there waiting for it to turn on by itself, bestie 😭 β€” it has to be done on each CPU using enable_percpu_irq.

also important: dev_id must be globally unique. it is a per-cpu variable, and the handler gets called with the interrupted CPU's instance of that variable. so yeah β€” the handler gets the right CPU's version, and that's the whole point. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file for this is ./kernel/irq/manage.c β€” that's where the lore lives β€” and here's the full SEE ALSO friend group, no skips, fr fr:


mwah πŸ’‹ β€” page source: ./kernel/irq; date: October 2026; function: request_percpu_irq_affinity(9). that's the footer, bestie, and we ate. πŸŽ€βœ¨

πŸ“¦ where this page comes from