cobalt/sched-quota: Account for already consumed time on limit update
If we change the quota value of thread group, we should take its already
consumed time during the current cycle into account. So far, we refilled
the budget blindly, which could have given the group an uncontrolled
"peak".
This commit first update the run_budget_ns of an active group and kills
its limit timer. Then it refills run_budget_ns only with the remaining
budget of the current cycle, taking the new quota as limit.
Accumulated credits are still dropped - not worth to deal with their
complexity in this scenario.
Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
Please register or sign in to comment