Re: [PATCH v7 26/26] drm/i915/gt: Add a spinlock to prevent starvation of irq_work.

Maarten Lankhorst
2026-03-10T19:03:18Z

Hey,

Den 2026-03-10 kl. 18:22, skrev Sebastian Andrzej Siewior:
> On 2026-03-10 12:57:08 [+0100], Maarten Lankhorst wrote:
>> --- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
>> @@ -487,8 +490,11 @@ void intel_context_remove_breadcrumbs(struct intel_context *ce,
>> if (release)
>> intel_context_put(ce);
>>
>> - while (atomic_read(&b->signaler_active))
>> + while (atomic_read(&b->signaler_active)) {
>> + spin_lock(&b->signaler_active_sync);
>> + spin_unlock(&b->signaler_active_sync);
>> cpu_relax();
>
> Forgot to mention: This is fine on PREEMPT_RT but on !RT you might need
>
> spin_lock_irqsave(&b->signaler_active_sync, flags);
> spin_unlock_irqrestore(&b->signaler_active_sync, flags);
>
> if the function can be called from !IRQ context which might be the case
> due to the irqsave() earlier in this function.
Yeah seems a bit of an oversight. I'll change it to use flags.

Is it correct to assume that irq_work disables interrupts on !RT?

Kind regards,
~Maarten Lankhorst