Re: [PATCH v4 12/38] drm/i915: Added scheduler hook into i915_gem_request_notify()

John Harrison
2016-01-12T11:25:16Z

On 11/01/2016 22:14, Chris Wilson wrote:
> On Mon, Jan 11, 2016 at 06:42:41PM +0000, John.C.Harrison@Intel.com wrote:
>> From: John Harrison <John.C.Harrison@Intel.com>
>>
>> The scheduler needs to know when requests have completed so that it
>> can keep its own internal state up to date and can submit new requests
>> to the hardware from its queue.
> Why would you reuse the user interrupt rather than introduce a
> context-switch interrupt using the pipe_notify/dword_notify (yes, it can
> be done by fixing up the current code). In the case of execlists you
> wouldn't even need to add another interrupt vector as you could just
> overload the execlists submission routine. For legacy, this would at
> least let you reduce the interrupt rate from per batch to per context
> switch, and keep the logic separate for user request tracking.
> -Chris
>

One of the scheduler's design goals is to throttle the number of batches
outstanding for any given context in order to improve responsiveness. In
order to track this, it needs to know about each individual batch
completion not the merged context completion (which could be for an
arbitrarily large number of batches due to coalescing in the
execlist/GuC layer).