[Intel-gfx] [PATCH] drm/i915/gt: Always reschedule the new heartbeat

Chris Wilson chris at chris-wilson.co.uk
Tue Mar 17 17:00:20 UTC 2020


Quoting Tvrtko Ursulin (2020-03-17 16:50:02)
> 
> On 17/03/2020 16:32, Chris Wilson wrote:
> > In order to better respond to new heartbeat intervals given via sysfs,
> > always reprogramme an active heartbeat upon change (i.e. use
> > mod_delayed_work to reschedule rather than queue_delayed_work which
> > ignores an already active work.)
> > 
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> >   drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> > index dd825718e4e5..5136c8bf112d 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> > @@ -31,7 +31,7 @@ static bool next_heartbeat(struct intel_engine_cs *engine)
> >       delay = msecs_to_jiffies_timeout(delay);
> >       if (delay >= HZ)
> >               delay = round_jiffies_up_relative(delay);
> > -     schedule_delayed_work(&engine->heartbeat.work, delay);
> > +     mod_delayed_work(system_wq, &engine->heartbeat.work, delay);
> >   
> >       return true;
> >   }
> > 
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> What about the transition from disabled (or long) preempt timeout to a 
> normal one?

They all use next_heartbeat() (from calling intel_engine_unpark_heartbeat)
to reschedule if going to an active heartbeat. On disable, we call
intel_engine_park_heartbeat() which does the cancel_delayed_work.
-Chris


More information about the Intel-gfx mailing list