Open mpe opened 2 years ago
I am able to recreate and understand how we are getting this issue incase PROVE_LOCKING and DEBUG_ATOMIC_SLEEP config options are enabled, as mentioned in the issue summary. When DEBUG_ATOMIC_SLEEP is enabled, mutex_lock internally calls "__might_resched" function, which will check if irq is disabled or not. Incase irq is disabled, it will trigger the warning pointed in the issue summary. Current IMC PMU code uses a mutex_lock in irq disabled section, hence we are getting this warning. I am working on changing mutex lock to spinlock as suggested by Michael Ellerman and also checking on adding testcases to test these scenarios for 24x7/imc.
The IMC PMU code uses a mutex lock in interrupt disabled sections.
With PROVE_LOCKING and DEBUG_ATOMIC_SLEEP we see:
Triggered by:
It may be as simple as turning
ref->lock
into a spinlock, but it will need testing.