Re: [PATCH v2] sched/fair: set burst to 0 when remove the restriction on cfs bandwidth

From: Tejun Heo
Date: Mon Jul 08 2024 - 14:08:31 EST


Hello,

On Mon, Jul 08, 2024 at 08:00:53PM +0800, Cheng Yu wrote:
> From: Zhao Wenhui <zhaowenhui8@xxxxxxxxxx>
>
> In the cpu subsystem of cgroup v1 and v2, we set the restriction on cfs
> bandwidth by setting the quota and burst value. Later, when we remove
> the restriction by setting the quota to the default value, the burst
> value should also be forced to the its default value of zero.

Explaining a bit why burst value should become zero can be helpful - ie.
what happens when quota is not set but burst is limited?

...
> @@ -10840,6 +10840,12 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota,
> burst + quota > max_cfs_runtime))
> return -EINVAL;
>
> + /*
> + * Ensure burst equals to zero when quota is -1.
> + */
> + if (quota == RUNTIME_INF && burst)
> + return -EINVAL;

This happening would be a bug, right? Would it make more sense to use
WARN_ON_ONCE()?

Thanks.

--
tejun