]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cgroup/cpuset: Free DL BW in case can_attach() fails
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Sun, 20 Aug 2023 15:22:58 +0000 (16:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 14:18:20 +0000 (16:18 +0200)
commit3cb86cc565df79e47f44eb6af062c94000b60972
tree2a03405630336efb6a73750115f142472d6a4941
parentffff4fc4bad76d115a3f3804883a1de05ee4e7aa
cgroup/cpuset: Free DL BW in case can_attach() fails

commit 2ef269ef1ac006acf974793d975539244d77b28f upstream.

cpuset_can_attach() can fail. Postpone DL BW allocation until all tasks
have been checked. DL BW is not allocated per-task but as a sum over
all DL tasks migrating.

If multiple controllers are attached to the cgroup next to the cpuset
controller a non-cpuset can_attach() can fail. In this case free DL BW
in cpuset_cancel_attach().

Finally, update cpuset DL task count (nr_deadline_tasks) only in
cpuset_attach().

Suggested-by: Waiman Long <longman@redhat.com>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ Conflict in kernel/cgroup/cpuset.c due to pulling extra neighboring
  functions that are not applicable on this branch. ]
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/sched.h
kernel/cgroup/cpuset.c
kernel/sched/core.c