Skip to content

irq: make arch_timer validation robust under tickless idle - #462

Merged
abbajaj806 merged 2 commits into
qualcomm-linux:mainfrom
smuppand:kernel-tests
May 29, 2026
Merged

irq: make arch_timer validation robust under tickless idle#462
abbajaj806 merged 2 commits into
qualcomm-linux:mainfrom
smuppand:kernel-tests

Conversation

@smuppand

@smuppand Srikanth Muppandam (smuppand) commented May 28, 2026

Copy link
Copy Markdown
Contributor

This PR makes the irq baseport test robust against false LAVA failures caused by passive arch_timer counter sampling.

The previous test logic sampled the arch_timer interrupt line, slept for a fixed window, and failed if every CPU counter did not increment. That assumption is weak on modern Linux systems because an online CPU may remain idle or tickless during the sampling window due to:

  • NO_HZ / tickless idle
  • CPU idle states
  • scheduler not placing work on a CPU
  • CPU isolation
  • affinity or cpuset restrictions
  • low system activity during LAVA runs
  • platform power management

This could produce false failures such as:

CPU3 initial=3764 final=3764 delta=0

lava job for reference with these changes. https://lava.infra.foundries.io/scheduler/job/236802#L2423

Add generic helpers to functestlib.sh for CPU list parsing, online CPU
detection, /proc/interrupts parsing, per-CPU interrupt counter reads,
CPU schedulability checks, and pinned CPU workload generation.

These helpers provide a reusable active interrupt validation path for
tests that need to verify per-CPU interrupt delivery without relying on
passive idle sampling. The helpers also preserve existing irq-style API
names such as get_interrupt_line_by_name(), extract_interrupt_cpu_counts(),
and count_interrupt_cpu_counts() for compatibility with existing tests.

This is needed because modern Linux systems can use tickless idle,
CPU idle states, CPU isolation, affinity restrictions, or low system
activity, where a CPU interrupt counter may not increment during a
passive sleep window even though the interrupt path is healthy.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Rework the irq test to avoid false LAVA failures caused by passively
sampling arch_timer counters during an idle sleep window.

The previous logic expected every CPU's arch_timer counter to increment
after a fixed sleep interval. That is not reliable on modern kernels
where CPUs may remain idle, tickless, isolated, or unscheduled.

Update the test to:
- expose runtime knobs through irq.yaml
- validate only online CPUs
- skip isolated or non-schedulable CPUs
- run controlled workload pinned to each testable CPU
- compare arch_timer counters before and after workload
- retry before declaring failure
- keep the single irq.res result flow

This validates the real requirement: an online schedulable CPU must
observe arch_timer progress while actively executing workload.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>

@abbajaj806 abbajaj806 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants