From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D1BD63A2 for ; Mon, 28 Aug 2023 10:50:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3497C433C7; Mon, 28 Aug 2023 10:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1693219824; bh=VlIYAwZcEWr66VmouWIigwQD2PNQEvEREKYvMl8ldGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YIlqn3DfdoXK1S2GuwvqZFQ/6uHPqNYVahhKkdW7gjVPkEn6w3ldOz87RfGGIwjFE zRWD+FK/Lw5R6LMIS2gouzyPzmub6bfDm5hEklEoqevcQUSFxhouryyHsEINW1qWPp JG5ShxFzxU6VWKlvOgu7ah95ncJ50QzfDH0vNMj8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Qais Yousef (Google)" , Juri Lelli , Waiman Long , Tejun Heo Subject: [PATCH 5.10 69/84] cgroup/cpuset: Iterate only if DEADLINE tasks are present Date: Mon, 28 Aug 2023 12:14:26 +0200 Message-ID: <20230828101151.611370344@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230828101149.146126827@linuxfoundation.org> References: <20230828101149.146126827@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Juri Lelli 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) Link: https://lore.kernel.org/lkml/20230206221428.2125324-1-qyousef@layalina.io/ Signed-off-by: Juri Lelli Reviewed-by: Waiman Long Signed-off-by: Tejun Heo Signed-off-by: Qais Yousef (Google) Signed-off-by: Greg Kroah-Hartman --- kernel/cgroup/cpuset.c | 3 +++ 1 file changed, 3 insertions(+) --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -937,6 +937,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)))