Commit 64668f1e authored by Dietmar Eggemann's avatar Dietmar Eggemann Committed by Treehugger Robot
Browse files

BACKPORT: sched/deadline: Create DL BW alloc, free & check overflow interface



While moving a set of tasks between exclusive cpusets,
cpuset_can_attach() -> task_can_attach() calls dl_cpu_busy(..., p) for
DL BW overflow checking and per-task DL BW allocation on the destination
root_domain for the DL tasks in this set.

This approach has the issue of not freeing already allocated DL BW in
the following error cases:

(1) The set of tasks includes multiple DL tasks and DL BW overflow
    checking fails for one of the subsequent DL tasks.

(2) Another controller next to the cpuset controller which is attached
    to the same cgroup fails in its can_attach().

To address this problem rework dl_cpu_busy():

(1) Split it into dl_bw_check_overflow() & dl_bw_alloc() and add a
    dedicated dl_bw_free().

(2) dl_bw_alloc() & dl_bw_free() take a `u64 dl_bw` parameter instead of
    a `struct task_struct *p` used in dl_cpu_busy(). This allows to
    allocate DL BW for a set of tasks too rather than only for a single
    task.

Bug: 238390134
Signed-off-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: default avatarJuri Lelli <juri.lelli@redhat.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
(cherry picked from commit 85989106
https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git

 cgroup/for-6.5)
[Trivial conflict due to clash with GKI specific code added in the same
location in the file]
Signed-off-by: default avatarQais Yousef <qyousef@google.com>
Change-Id: I569877547ff7c6d20309f006382b7a416d656fb8
parent bba2dd99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment