mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
drm/i915/gt: Shrink the critical section for irq signaling
Let's only wait for the list iterator when decoupling the virtual breadcrumb, as the signaling of all the requests may take a long time, during which we do not want to keep the tasklet spinning. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201224135544.1713-6-chris@chris-wilson.co.uk
This commit is contained in:
parent
bab0557c8d
commit
66e40750d2
|
|
@ -234,6 +234,7 @@ static void signal_irq_work(struct irq_work *work)
|
|||
intel_breadcrumbs_disarm_irq(b);
|
||||
|
||||
rcu_read_lock();
|
||||
atomic_inc(&b->signaler_active);
|
||||
list_for_each_entry_rcu(ce, &b->signalers, signal_link) {
|
||||
struct i915_request *rq;
|
||||
|
||||
|
|
@ -269,6 +270,7 @@ static void signal_irq_work(struct irq_work *work)
|
|||
}
|
||||
}
|
||||
}
|
||||
atomic_dec(&b->signaler_active);
|
||||
rcu_read_unlock();
|
||||
|
||||
llist_for_each_safe(signal, sn, signal) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ struct intel_breadcrumbs {
|
|||
spinlock_t signalers_lock; /* protects the list of signalers */
|
||||
struct list_head signalers;
|
||||
struct llist_head signaled_requests;
|
||||
atomic_t signaler_active;
|
||||
|
||||
spinlock_t irq_lock; /* protects the interrupt from hardirq context */
|
||||
struct irq_work irq_work; /* for use from inside irq_lock */
|
||||
|
|
|
|||
|
|
@ -594,7 +594,8 @@ static void kick_siblings(struct i915_request *rq, struct intel_context *ce)
|
|||
* ce->signal_link.
|
||||
*/
|
||||
i915_request_cancel_breadcrumb(rq);
|
||||
irq_work_sync(&engine->breadcrumbs->irq_work);
|
||||
while (atomic_read(&engine->breadcrumbs->signaler_active))
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
if (READ_ONCE(ve->request))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user