From 00592c2f0c07db93ff9370c60ae4f11967d8d5ea Mon Sep 17 00:00:00 2001 From: Fothsid <18036123+Fothsid@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:31:47 +0100 Subject: [PATCH] fix: check for EPERM when setting IRQ affinity Kernel version v6.12 changed the return code of the write_irq_affinity() function in case if affinity cannot be set for the specified IRQ. Used to be EIO, now it's EPERM. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eb29369fa543e7d5557c19ebecf072244bb14815 Resolves: RHEL-153655 --- tuned/plugins/plugin_scheduler.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index ca0b8eb..72aeb87 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -1317,12 +1317,13 @@ class SchedulerPlugin(base.Plugin): f.write(affinity_hex) return 0 except (OSError, IOError) as e: - # EIO is returned by + # EPERM is returned by # kernel/irq/proc.c:write_irq_affinity() if changing # the affinity is not supported - # (at least on kernels 3.10 and 4.18) - if hasattr(e, "errno") and e.errno == errno.EIO \ - and not restoring: + # Before kernel v6.12, write_irq_affinity() returned EIO + # instead of EPERM, hence the check for both error codes. + if hasattr(e, "errno") and (e.errno == errno.EIO \ + or e.errno == errno.EPERM) and not restoring: log.debug("Setting SMP affinity of IRQ %s is not supported" % irq) return -2