Re: [PATCH 07/10] drm/i915: Restructure priority inheritance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Andi Shyti (2021-01-26 17:18:22)
> Hi Chris,
> 
> > +             local_bh_disable();
> > +             i915_request_set_priority(rq, prio);
> > +             local_bh_enable();
> > +
> > +             i915_request_put(rq);
> > +             rq = ptr_mask_bits(rn, 1);
> 
> why are you using ptr_mask_bits here?
> 
> > +     } while (rq);
> > +}
> > +
> > +void i915_sched_init_ipi(struct i915_sched_ipi *ipi)
> > +{
> > +     INIT_WORK(&ipi->work, ipi_schedule);
> > +     ipi->list = NULL;
> > +}
> > +
> > +static void __ipi_add(struct i915_request *rq)
> > +{
> > +#define STUB ((struct i915_request *)1)
> > +     struct intel_engine_cs *engine = READ_ONCE(rq->engine);
> > +     struct i915_request *first;
> > +
> > +     if (!i915_request_get_rcu(rq))
> > +             return;
> > +
> > +     if (__i915_request_is_complete(rq) ||
> > +         cmpxchg(&rq->sched.ipi_link, NULL, STUB)) { /* already queued */
> > +             i915_request_put(rq);
> > +             return;
> > +     }
> > +
> > +     first = READ_ONCE(engine->execlists.ipi.list);
> > +     do
> > +             rq->sched.ipi_link = ptr_pack_bits(first, 1, 1);
> 
> ... and why ptr_pack_bits here?
> 
> do they make any difference?

We are using bit0 to differentiate against NULL. So we use the special
value of (void*)1 to mark when the elements is active, but pointing to
nothing.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux