This is a note to let you know that I've just added the patch titled cgroup/cpuset: Iterate only if DEADLINE tasks are present to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: cgroup-cpuset-iterate-only-if-deadline-tasks-are-present.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From stable-owner@xxxxxxxxxxxxxxx Sun Aug 20 17:25:09 2023 From: Qais Yousef <qyousef@xxxxxxxxxxx> Date: Sun, 20 Aug 2023 16:24:15 +0100 Subject: cgroup/cpuset: Iterate only if DEADLINE tasks are present To: stable@xxxxxxxxxxxxxxx Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>, Waiman Long <longman@xxxxxxxxxx>, Tejun Heo <tj@xxxxxxxxxx>, Dietmar Eggemann <dietmar.eggemann@xxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Vincent Guittot <vincent.guittot@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Hao Luo <haoluo@xxxxxxxxxx>, John Stultz <jstultz@xxxxxxxxxx>, cgroups@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Qais Yousef <qyousef@xxxxxxxxxxx> Message-ID: <20230820152417.518806-5-qyousef@xxxxxxxxxxx> From: Juri Lelli <juri.lelli@xxxxxxxxxx> commit c0f78fd5edcf29b2822ac165f9248a6c165e8554 upstream. update_tasks_root_domain currently iterates over all tasks even if no DEADLINE task is present on the cpuset/root domain for which bandwidth accounting is being rebuilt. This has been reported to introduce 10+ ms delays on suspend-resume operations. Skip the costly iteration for cpusets that don't contain DEADLINE tasks. Reported-by: Qais Yousef (Google) <qyousef@xxxxxxxxxxx> Link: https://lore.kernel.org/lkml/20230206221428.2125324-1-qyousef@xxxxxxxxxxx/ Signed-off-by: Juri Lelli <juri.lelli@xxxxxxxxxx> Reviewed-by: Waiman Long <longman@xxxxxxxxxx> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx> Signed-off-by: Qais Yousef (Google) <qyousef@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- kernel/cgroup/cpuset.c | 3 +++ 1 file changed, 3 insertions(+) --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1092,6 +1092,9 @@ static void dl_update_tasks_root_domain( struct css_task_iter it; struct task_struct *task; + if (cs->nr_deadline_tasks == 0) + return; + css_task_iter_start(&cs->css, 0, &it); while ((task = css_task_iter_next(&it))) Patches currently in stable-queue which might be from stable-owner@xxxxxxxxxxxxxxx are queue-6.1/cgroup-cpuset-free-dl-bw-in-case-can_attach-fails.patch queue-6.1/sched-cpuset-keep-track-of-sched_deadline-task-in-cpusets.patch queue-6.1/cgroup-cpuset-rename-functions-dealing-with-deadline-accounting.patch queue-6.1/cgroup-cpuset-iterate-only-if-deadline-tasks-are-present.patch queue-6.1/sched-cpuset-bring-back-cpuset_mutex.patch queue-6.1/sched-deadline-create-dl-bw-alloc-free-check-overflow-interface.patch