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 CCBE7611A for ; Mon, 28 Aug 2023 10:34:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E7D6C433C7; Mon, 28 Aug 2023 10:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1693218844; bh=ktOF3DJMGVCV2S53ojkfSawUT3dchceVW5yGQcF28To=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qf9sO5fiiSVVgShoRG3FwNpi3L/AqZ9Ax3PVK3cs4Ap8Ij88uK5JNeH8BlHZprcSz OBuX/faz4EtcepT+1gV9TA4UKG1zK1D7HNxMz7Ka3ybTrQUI/6VHZ0TRYzWCVJ+L3S PWXY8WUJ8IhBsVZzcdIjz5CvV66x2qmYCQ8jyteo= 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 6.1 104/122] cgroup/cpuset: Iterate only if DEADLINE tasks are present Date: Mon, 28 Aug 2023 12:13:39 +0200 Message-ID: <20230828101159.878367935@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230828101156.480754469@linuxfoundation.org> References: <20230828101156.480754469@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 6.1-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 @@ -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)))