Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8a4e0b69 authored by Jordan Crouse's avatar Jordan Crouse Committed by Stephen Boyd
Browse files

msm: kgsl: Fix draw context fair scheduling in the dispatcher



Commit a8330f853988137425346ce8050970e6a19b64ae broke the fair scheduling
alogrithm in the dispatcher. That commit copied off the current pending
queue into a temporary list and processed it one by one.  After all the
inflight slots were filled the remaining contexts were pushed back on
the list.  Consider the following situation - max inflight is 15, current
inflight is 14 (room for 1 more command batch). There are two contexts
in the queue:

  a -> b

The contexts are copied to a temporary list so now the pending list is
empty.  'a' is processed first and submits one command batch.  After
successfully processing the command it is put back on the pending list:

 a

inflight is now full, so 'b' doesn't process anything - it gets shoved
back on the pending list:

 a -> b

See the problem?  In a fair scheduling scenario, 'b' should be first so
it has a chance to be processed the next time there is room in the queue.
Instead 'a' will dominate the time - hilarity ensues.

This is fixed by putting successfully processed contexts on to a requeue
list and then pushing them back on at the end keeping unprocessed
contexts on the master list which ensures fair scheduling (there is a
scenario where two processed contexts could swap spots, but that isn't as
big a deal as long as they both got their timeslice).

Change-Id: Ic0dedbad658dacc43efc972f7731f345f1ec8a79
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 893078aa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment