Skip to content

balloons: IRQ CPU affinity controls#722

Open
askervin wants to merge 5 commits into
containers:mainfrom
askervin:5iH-balloon-irq
Open

balloons: IRQ CPU affinity controls#722
askervin wants to merge 5 commits into
containers:mainfrom
askervin:5iH-balloon-irq

Conversation

@askervin

Copy link
Copy Markdown
Collaborator

Control IRQ CPU affinities using new irqClaim and irqMode balloon type options.

For each IRQ, the logic is:

  1. Find balloons that want exactly this IRQ (irqClaim matches) and set IRQ's CPU affinity to union of their CPUs.
  2. If no balloon claimed the IRQ, then find balloons that want all IRQs (irqMode: sink), and set CPU affinity to union of sink balloons' CPUs.
  3. With no claims and sinks around for the IRQ, find balloons that do not want any IRQs (irqMode: isolate), and set CPU affinity to all the remaining CPUs.
  4. If no irqClaim and irqMode options are present in existing balloon instances, but they are used in some balloon types, let IRQs run on all CPUs.
  5. If no irqClaim and irqMode options are present in any balloon types, do not touch IRQ CPU affinities in the system.

Combining irqClaim with "irqMode: isolate" in the same balloon type creates balloons that handle only claimed IRQs and no others.

askervin added 5 commits July 23, 2026 17:17
Add pkg/irq for reading interrupts from /proc/interrupts and reading
and writing CPU affinities through /proc/irq/NUMBER/smp_affinity_list.
Wire the proc root to the plugin host root and mount the host proc
filesystem into the balloons daemonset so that affinities of host IRQs
can be updated (write access needed).

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
Add the balloon type options irqClaim and irqMode to the balloons
policy configuration.

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
Set CPU affinities of system IRQs according to the irqClaim and
irqMode balloon type options.

For each IRQ, the logic is: find balloons that want exactly this
IRQ (irqClaim). If nobody, then find balloons that want all
IRQs (irqMode: sink). If no volunteers, then list balloons that do not
want any IRQs (irqMode: isolate), and set IRQs affinity to all those
who do not care. The default is nobody cares (no irq options present),
meaning that the balloons policy will not touch IRQ CPU affinities at
all, keeping the original behavior. Affinities are updated after
balloon changes.

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
Add an end-to-end test that verifies irqClaim, irqMode sink and
irqMode isolate by inspecting /proc/irq affinities on the test VM.

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
Describe the irqClaim and irqMode balloon type options and their common
use cases.

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
@askervin
askervin requested review from kad and klihub July 23, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant