RFC Deadline scheduler and other ideas
Get series with b4
b4 am [email protected]Versions newest first
- v2 RFC Latest18 patches 21 repliesIn review
Changes in v2 from the cover letter
* Fixed many rebase errors.
* Added some new patches.
* Dropped single shot dependecy handling.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | drm/amdgpu: Use DRM scheduler API in amdgpu_xcp_release_scheddrivers/ | +1 | 3 replies | |
| 2/18 | drm/sched: Delete unused update_job_creditsdrivers/ include/ | +0 | 0 replies | |
| 3/18 | drm/sched: Remove one local variabledrivers/ | +1 | 4 replies | |
| 4/18 | drm/sched: Remove weak paused submission checksdrivers/ | +0 | 0 replies | |
| 5/18 | drm/sched: Avoid double re-lock on the job free pathdrivers/ | +11 | 0 replies | |
| 6/18 | drm/sched: Add helper to check job dependenciesdrivers/ include/ | +25 | 1 reply | |
| 7/18 | drm/imagination: Use the drm_sched_job_has_dependency helperdrivers/ | +3 | 2 replies | |
| 8/18 | drm/sched: Clarify locked section in drm_sched_rq_select_entity_fifodrivers/ | +17 | 0 replies | |
| 9/18 | drm/sched: Remove idle entity from treedrivers/ drivers/ include/ | +12 | 0 replies | |
| 10/18 | drm/sched: Implement RR via FIFOdrivers/ drivers/ include/ | +39 | 4 replies | |
| 11/18 | drm/sched: Consolidate entity run queue managementdrivers/ drivers/ include/ | +88 | 0 replies | |
| 12/18 | drm/sched: Move run queue related code into a separate filedrivers/ drivers/ drivers/ +1 more | +222 | 2 replies | |
| 13/18 | drm/sched: Add deadline policydrivers/ drivers/ drivers/ +1 more | +64 | 0 replies | |
| 14/18 | drm/sched: Remove FIFO and RR and simplify to a single run queuedrivers/ drivers/ drivers/ +2 more | +56 | 1 reply | |
| 15/18 | drm/sched: Queue all free credits in one worker invocationdrivers/ drivers/ include/ | +54 | 0 replies | |
| 16/18 | drm/sched: Connect with dma-fence deadlinesdrivers/ | +22 | 4 replies | |
| 17/18 | drm/sched: Embed run queue singleton into the schedulerdrivers/ drivers/ drivers/ +8 more | +58 | 0 replies | |
| 18/18 | drm/sched: Scale deadlines depending on queue depthdrivers/ include/ | +20 | 0 replies |
Reviews trailers per patch
4 of 18 patches have a Reviewed-by or Acked-by.
| Patch | Danilo Krummrich | Boris Brezillon | Matt Coster | Christian König |
|---|---|---|---|---|
| 1/18 | R-b | |||
| 2/18 | A-b | A-b | A-b | |
| 3/18 | ||||
| 4/18 | ||||
| 5/18 | ||||
| 6/18 | R-b | |||
| 7/18 | R-b | |||
| 8/18 | ||||
| 9/18 | ||||
| 10/18 | ||||
| 11/18 | ||||
| 12/18 | ||||
| 13/18 | ||||
| 14/18 | ||||
| 15/18 | ||||
| 16/18 | ||||
| 17/18 | ||||
| 18/18 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [RFC v2 00/18] Deadline scheduler and other ideas
<tldr>
Replacing FIFO with a flavour of deadline driven scheduling and removing round- robin. Connecting the scheduler with dma-fence deadlines. Second 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.
</tldr>
If I remember correctly Christian mentioned recently (give or take) that maybe round-robin could be removed. That got me thinking how and what could be improved and simplified. 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.
One big question is whether round-robin can really be removed. Does anyone use it, rely on it, or what are even use cases where it is much better than FIFO.
See "drm/sched: Add deadline policy" commit message for a short description on what flavour of deadline scheduling it is. But in essence it should a more fair FIFO where higher priority can not forever starve lower priorities.
"drm/sched: Connect with dma-fence deadlines" wires up dma-fence deadlines to the scheduler because it is easy and makes logical sense with this. And I noticed userspace already uses it so why not wire it up fully.
Otherwise the series is a bit of progression from trivial cleanups to consolidating RR into FIFO code paths and going from there to deadline and then some code simplification to 1:1 run queue to scheduler relationship, because deadline does not need per priority run queues.
There is quite a bit of code to go throught here so I think it could be even better if other drivers could give it a spin as is and see if some improvements can be detected. Or at least no regressions.
v2:
* Fixed many rebase errors.
* Added some new patches.
* Dropped single shot dependecy handling.
Tvrtko Ursulin (18):
drm/amdgpu: Use DRM scheduler API in amdgpu_xcp_release_sched drm/sched: Delete unused update_job_credits
drm/sched: Remove one local variable
drm/sched: Remove weak paused submission checks drm/sched: Avoid double re-lock on the job free path drm/sched: Add helper to check job dependencies drm/imagination: Use the drm_sched_job_has_dependency helper drm/sched: Clarify locked section in drm_sched_rq_select_entity_fifo drm/sched: Remove idle entity from tree
drm/sched: Implement RR via FIFO
drm/sched: Consolidate entity run queue management drm/sched: Move run queue related code into a separate file drm/sched: Add deadline policy
drm/sched: Remove FIFO and RR and simplify to a single run queue drm/sched: Queue all free credits in one worker invocation drm/sched: Connect with dma-fence deadlines
drm/sched: Embed run queue singleton into the scheduler drm/sched: Scale deadlines depending on queue depth
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 27 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 10 +- drivers/gpu/drm/imagination/pvr_job.c | 12 +- drivers/gpu/drm/scheduler/Makefile | 2 +- drivers/gpu/drm/scheduler/sched_entity.c | 147 +++--- drivers/gpu/drm/scheduler/sched_fence.c | 2 +- drivers/gpu/drm/scheduler/sched_main.c | 541 ++++---------------- drivers/gpu/drm/scheduler/sched_rq.c | 177 +++++++ include/drm/gpu_scheduler.h | 55 +- 13 files changed, 424 insertions(+), 576 deletions(-) create mode 100644 drivers/gpu/drm/scheduler/sched_rq.c
Signature · 1 line
2.47.1