Skip to content

Commit e55a133

Browse files
committed
Prescribe less extreme borrowing by exempt priority levels
Signed-off-by: Mike Spreitzer <[email protected]>
1 parent 060cedf commit e55a133

File tree

1 file changed

+20
-14
lines changed
  • keps/sig-api-machinery/1040-priority-and-fairness

1 file changed

+20
-14
lines changed

keps/sig-api-machinery/1040-priority-and-fairness/README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -930,31 +930,37 @@ Not that this matters much, because dispatching for those is not
930930
actually limited. The sum of those limits, however, is subtracted
931931
from `ServerCL` to produce a value called `RemainingServerCL` that is
932932
used in computing the allocations for the non-exempt priority levels.
933-
If `RemainingServerCL` is zero or negative then all the non-exempt
934-
priority levels get `CurrentCL = 0`. Otherwise, the computation
935-
proceeds as follows.
936933

937934
Because of the borrowing by exempt priority levels, lower bounds could
938-
be problematic. Define `LowerBoundSum` as follows.
935+
be problematic. Define `MinCLSum` and `MinCurrentCLSum` as follows.
939936

940937
```
941-
LowerBoundSum = sum[non-exempt priority level i] MinCurrentCL(i)
938+
MinCLSum = sum[non-exempt priority level i] MinCL(i)
939+
MinCurrentCLSum = sum[non-exempt priority level i] MinCurrentCL(i)
942940
```
943941

944-
If `LowerBoundSum = RemainingServerCL` then there is no wiggle room:
945-
each non-exempt priority level gets `CurrentCL = MinCurrentCL`.
942+
When `RemainingServerCL < MinCLSum`, the expected usage by the exempt
943+
levels is so high that we would like to give the non-exempt levels
944+
less than their minimum. But that could be problematic. So in this
945+
case and when `RemainingServerCL = MinCLSum` we set `CurrentCL` for
946+
the non-exempt levels by the following formula.
946947

947-
If `LowerBoundSum > RemainingServerCL` then the problem is
948-
over-constrained. The solution taken is to reduce all the lower
949-
bounds in the same proportion, to the point where their sum is
950-
feasible. At that point, there is no wiggle room. Thus, in this case
951-
the settings are as follows.
948+
```
949+
CurrentCL(i) = MinCL(i)
950+
```
951+
952+
When `MinCLSum < RemainingServerCL < MinCurrentCLSum`, the concurrency
953+
available to non-exempt levels is above their rock-bottom limit but
954+
not enough to give each its `MinCurrentCL`. In this case and when
955+
`RemainingServerCL = MinCurrentCLSum` we share the excess above
956+
`MinCL` proportionally, using the following formula.
952957

953958
```
954-
CurrentCL(i) = MinCurrentCL(i) * RemainingServerCL / LowerBoundSum
959+
CurrentCL(i) = MinCL(i) + ( MinCurrentCL(i) - MinCL(i) ) *
960+
(RemainingServerCL-MinCLSum) / (MinCurrentCLSum-MinCLSum)
955961
```
956962

957-
Finally, when `LowerBoundSum < RemainingServerCL` there _is_ wiggle
963+
Finally, when `MinCurrentCLSum < RemainingServerCL` there _is_ wiggle
958964
room and the borrowing computation proceeds as follows.
959965

960966
The non-exempt priority levels would all be fairly happy if we set

0 commit comments

Comments
 (0)