On 2026-07-09 13:03:30 [+0200], Maarten Lankhorst wrote:
> Would the below look good?
> 
> The engine->busyness() callbacks called from the selftests are on PREEMPT_RT
> not safe with preemption disabled, because all spinlocks are converted to
> rt-mutexes.

 "all spinlock_t locks becomes sleeping locks on PREEMPT_RT and must not
 be acquired with disabled preemption."

> This is also a problem for perf events, where we have to disable
> the busyness events on PREEMPT_RT.

perf events as in hardirq or irq_work? If hardirq and spinlock_t then
lockdep might complain.

> Previous attempts to fix this failed, so convert the selftest code to read
> engine->busyness()  with migrate_disable() instead of preempt_disable() to
> prevent selftest failures on PREEMPT_RT.

You might want to describe why this swap is safe or what the requirement
is here. My guess would be that preempt_disable() is here to ensure that
the two reads from intel_engine_get_busy_time() are 100us delay and not
10ms due to a context switch. But then this has no impact on the
returned value since it measures the busy-time of the HW which should
report 0 if idle.

Sebastian

Reply via email to