Re: [RFC PATCH 2/2] sched/eevdf: Introduce a cgroup interface for slice

From: Tianchen Ding
Date: Mon Oct 28 2024 - 22:07:48 EST


On 2024/10/29 01:37, Tejun Heo wrote:
Hello,

On Mon, Oct 28, 2024 at 02:33:13PM +0800, Tianchen Ding wrote:
Introduce "cpu.fair_slice" for cgroup v2 and "cpu.fair_slice_us" for v1
according to their name styles. The unit is always microseconds.

A cgroup with shorter slice can preempt others more easily. This could be
useful in container scenarios.

By default, cpu.fair_slice is 0, which means the slice of se is
calculated by min_slice from its cfs_rq. If cpu.fair_slice is set, it
will overwrite se->slice with the customized value.

Provided that this tunable is necessary, wouldn't it be more useful to
figure out what per-task interface would look like first? Maybe there are
cases where per-cgroup slice config makes sense but that sounds
significantly less useful than being able to configure it per-task.

Thanks.


For eevdf, per-task interface has been introduced in commit 857b158dc5e8 ("sched/eevdf: Use sched_attr::sched_runtime to set request/slice suggestion")

So This patch is trying to introduce a cgroup level interface.

Thanks.