• Jan Kiszka's avatar
    cobalt/sched-quota: Account for already consumed time on limit update · f116e7eb
    Jan Kiszka authored
    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
    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's avatarJan Kiszka <jan.kiszka@siemens.com>
sched-quota.c 21.7 KB