Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pyperf/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os.path
import platform
import re
import stat
import struct
import subprocess
import sys
Expand Down Expand Up @@ -822,6 +823,13 @@ def write_irq(self, irq, cpus):
path = self.irq_affinity_path % irq
mask = format_cpus_as_mask(cpus)
try:
# The kernel makes smp_affinity read-only for an IRQ whose
# affinity can't be set, such as the cascade IRQ 2 or a
# kernel-managed IRQ. Since Linux 6.12, writing to it fails
# with EPERM rather than EIO, which looks like a permission
# error and would stop the loop over IRQs. Skip it instead.
if not os.stat(path).st_mode & stat.S_IWUSR:
return False
write_text(path, mask)
return True
except OSError as exc:
Expand Down
Loading