Tvrtko Ursulin with Igalia sent out a “request for comments” patch series today working on a deadline scheduling policy for the DRM scheduler that is used across different Direct Rendering Manager kernel graphics drivers.
The “DRM sched” common DRM scheduler that was originally born out of the AMDGPU scheduler code is now used by Intel and other kernel graphics drivers. Following discussions and comments by other DRM driver developers, Tvrtko Ursulin has been exploring the possibility of a deadline policy for the DRM scheduler and the possibility it could replace the First In First Out (FIFO) handling.
Ursulin summed things up with:
“Replacing FIFO with a flavour of deadline driven scheduling and removing round-robin. Connecting the scheduler with dma-fence deadlines. First draft and testing by different drivers and feedback would be nice. I was only able to test it with amdgpu. Other drivers may not even compile.”
The deadline policy for the DRM scheduler is explained in the policy patch as:
“Deadline scheduling policy should be a fairer flavour of FIFO with two main advantages being that it can naturally connect with the dma-fence deadlines, and secondly that it can get away with multiple run queues per scheduler.
From the latter comes the fairness advantage. Where the current FIFO policy will always starve low priority entities by normal, and normal by high etc, deadline tracks all runnable entities in a single run queue and assigns them deadlines based on priority. Instead of being ordered strictly by priority, jobs and entities become ordered by deadlines.
This means that a later higher priority submission can still overtake an earlier lower priority one, but eventually the lower priority will get its turn even if high priority is constantly feeding new work.”
While a deadline policy for DRM sched has been talked about before, the quality of this implementation and if it will ultimately be beneficial remain to be seen:
“So I played a bit in the scheduler code and came up with something which appears to not crash at least. Whether or not there are significant advantages apart from maybe code consolidation and reduction is the main thing to be determined.”
See the RFC patch series while it will be interesting to see where this work leads in 2025.