Re: [PATCH 2/2] drm/scheduler: Add a start_timeout_notify() backend function

Koenig, Christian
2018-11-05T12:06:58Z

[SNIP]

Am 05.11.18 um 08:55 schrieb Sharat Masetty:
> Hi Christian,
>
> Yes something like a suspend timeout would be simpler for the drivers,
> but I could not find anything which does this for the delayed work or
> even for the general timers. All I could find was cancel/delete.
>
> In lieu of this, I chose this approach. If you like it this
> way(proposed patch), then I will address the review comments and
> re-spin... please let me know.
>
> Sharat

I think I would prefer investigating into the suspend/resume approach
for a moment.

What we can do rather easily is to use mod_delayed_work() with a larger
timeout, e.g. like the following:

void drm_sched_suspend_timeout()
{
mod_delayed_work(&sched->work_tdr, sched->timeout * 10);
}

void drm_sched_resume_timeout()
{
mod_delayed_work(&sched->work_tdr, sched->timeout);
}

By looking at work_tdr.timer.expires before modifying it
drm_sched_suspend_timeout() could also return the remaining jiffies to wait.

This way we wouldn't need to restart the timeout completely on every resume.

Regards,
Christian.