__irq_domain_alloc_irqs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __irq_domain_alloc_irqs (9) β€” Kernel API Manual ✨

okay bestie, welcome to the Kernel API Manual page for __irq_domain_alloc_irqs β€” yes that's a lot of underscores, no we're not scared, she's iconic πŸŽ€


🌸 NAME 🌸

__irq_domain_alloc_irqs β€” literally just Allocate IRQs from domain. that's it. that's the job. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int __irq_domain_alloc_irqs (struct irq_domain *domain , int irq_base ,
unsigned int nr_irqs , int node , void *arg , bool realloc , const
struct irq_affinity_desc *affinity );

seven args. seven. she's high-maintenance but she delivers 🫢


✨ ARGUMENTS ✨

  • domain β€” the domain you're allocating from, aka the vibe source 🌈
  • irq_base β€” if it's >= 0, allocate that specific IRQ number, like reserving the exact seat you want fr fr
  • nr_irqs β€” how many IRQs you want. count them. actually count them πŸ’€
  • node β€” the NUMA node id, for the memory allocation 🧚
  • arg β€” domain-specific argument, the little mystery bag each domain gets to define itself πŸ™ˆ
  • realloc β€” if true, the IRQ descriptors have already been allocated, so we're re-allocating, not allocating fresh πŸ‘‘
  • affinity β€” optional IRQ affinity mask for multiqueue devices. optional, but a lot of devices are obsessed with it ⭐

πŸ’– DESCRIPTION πŸ’–

so what she does: allocates IRQ numbers and initializes all the data structures needed to support hierarchy IRQ domains. all of them. the whole scaffolding πŸ’…

the realloc parameter is lowkey mainly there to support legacy IRQs β€” not her main character era, but she shows up for the old heads πŸŽ€

she returns an error code or the allocated IRQ number. so like, check your return value. always. ngl this is the vibe check of the whole function πŸ”₯

and here's the part that's giving ✨ architecture ✨ β€” the whole process of setting up an IRQ has been split into two steps:

  1. __irq_domain_alloc_irqs β€” the first step, allocating the IRQ descriptor and the required hardware resources 🌸
  2. irq_domain_activate_irq β€” the second step, programming the hardware with those preallocated resources πŸ¦‹

and why are we splitting it, you ask? because it makes it easier to rollback when failing to allocate resources. she plans ahead. she has an exit strategy. main character energy fr fr 😭

ngl the two-step thing is the whole point β€” allocate first, program hardware second, so a failure doesn't leave you scrambling πŸ’€

πŸ’œ SEE ALSO πŸ’œ

kernel file ./kernel/irq/irqdomain.c πŸ‘€ and honestly the whole friend group:


okay that's the page!! 🫢 sign-off time: this lil masterpiece lives in the ./kernel/irq source tree, dated October 2026, and it's page __irq_domain_alloc_irqs(9) of the Kernel API Manual β€” go allocate responsibly bestie, and check that return value πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from