A Priority Scheduler Is Being Worked On For Intel's DRM Driver

Written by Michael Larabel in Intel on 2 November 2016 at 04:39 PM EDT. 2 Comments
INTEL
A trivial priority scheduler is being worked on for Intel's i915 Direct Rendering Manager driver for the Linux kernel.

Intel OTC developer Chris Wilson explained of the work, "Now that the tree has caught up, we can now look at the next steps towards a basic scheduler. No timeslicing, no preemption, no fairness, we simply choose the highest priority request to execute next. (An incoming high priority request will bump the priority on its prerequisites so that it will execute at the earliest opportunity.)"

The patch comments go on to elaborate the scheduler approach, "The priority of the request is determined by the user (eventually via the context) but may be overridden at any time by the driver. When we set the priority of the request, we bump the priority of all of its dependencies to match - so that a high priority drawing operation is not stuck behind a background task."

The priority scheduler in its current form can be found on the intel-gfx list and is implemented across 12 patches, including the prerequisites like deferred scheduling. With the patches, the priority of any rendering needed for the next page-flip is boosted by default. Or as Chris puts it, "We prioritise avoiding jank and jitter in the GUI over starving background tasks."

Besides lifting the priority of rendering work needed to get out the next page-flip, it's also exposed to user-space so that it can then be hooked by extensions such as EGL_IMG_context_priority for lowering or raising the priority of an individual workload.
Normal users can specify any value in the range of -1023 to 0 [default], i.e. they can reduce the priority of their workloads (and temporarily boost it back to normal if so desired).

Privileged users can specify any value in the range of -1023 to 1023, [default is 0], i.e. they can raise their priority above all overs and so potentially starve the system.

Note that the existing schedulers are not fair, nor load balancing, the execution is strictly by priority on a first-come, first-served basis, and the driver may choose to boost some requests above the range available to users.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week