Update the details of GRUB to reflect the updated logic. Signed-off-by: Vineeth Pillai (Google) <vineeth@xxxxxxxxxxxxxxx> --- Documentation/scheduler/sched-deadline.rst | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/scheduler/sched-deadline.rst index 9d9be52f221a..0c73f07f712d 100644 --- a/Documentation/scheduler/sched-deadline.rst +++ b/Documentation/scheduler/sched-deadline.rst @@ -195,11 +195,15 @@ Deadline Task Scheduling its utilization is added to the active utilization of the runqueue where it has been enqueued. - For each runqueue, the algorithm GRUB keeps track of two different bandwidths: + For each runqueue, the algorithm GRUB keeps track of three different bandwidths: - Active bandwidth (running_bw): this is the sum of the bandwidths of all tasks in active state (i.e., ActiveContending or ActiveNonContending); + - Active bandwidth of SCHED_FLAG_RECLAIM tasks(reclaim_bw): this is the sum of + bandwidth of all tasks in active state which participates in GRUB. This is a + subset of running_bw and is needed for reclaimable bandwidth calculation. + - Total bandwidth (this_bw): this is the sum of all tasks "belonging" to the runqueue, including the tasks in Inactive state. @@ -209,12 +213,12 @@ Deadline Task Scheduling to dq = -max{ Ui / Umax, (1 - Uinact - Uextra) } dt + dq = -(Ureclaim / (Uextra + Uinact + Ureclaim)) dt where: - - Ui is the bandwidth of task Ti; - - Umax is the maximum reclaimable utilization (subjected to RT throttling - limits); + - Ureclaim is the (per runqueue) bandwidth of all SCHED_FLAG_RECLAIM tasks + in active state; - Uinact is the (per runqueue) inactive utilization, computed as (this_bq - running_bw); - Uextra is the (per runqueue) extra reclaimable utilization @@ -222,7 +226,8 @@ Deadline Task Scheduling Let's now see a trivial example of two deadline tasks with runtime equal - to 4 and period equal to 8 (i.e., bandwidth equal to 0.5):: + to 4 and period equal to 8 (i.e., bandwidth equal to 0.5). Tasks are + allowed to use the whole cpu(Umax = 1):: A Task T1 | @@ -244,7 +249,7 @@ Deadline Task Scheduling 0 1 2 3 4 5 6 7 8 - A running_bw + A reclaim_bw | 1 ----------------- ------ | | | @@ -272,7 +277,7 @@ Deadline Task Scheduling This is the 0-lag time for Task T1. Since it didn't woken up in the meantime, it enters the Inactive state. Its bandwidth is removed from - running_bw. + running_bw and reclaim_bw. Task T2 continues its execution. However, its runtime is now decreased as dq = - 0.5 dt because Uinact = 0.5. Task T2 therefore reclaims the bandwidth unused by Task T1. @@ -280,7 +285,7 @@ Deadline Task Scheduling - Time t = 8: Task T1 wakes up. It enters the ActiveContending state again, and the - running_bw is incremented. + running_bw and reclaim_bw are incremented. 2.3 Energy-aware scheduling -- 2.40.1