Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2218517rwj; Mon, 19 Dec 2022 01:07:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXvuauymlNCRAdVz0HJEuosVQlc5dCkJYw8lPM8i09tpZ2+Omf7o9WDZCJUowmoF0CL4xM5r X-Received: by 2002:a17:902:b109:b0:191:29c7:aa96 with SMTP id q9-20020a170902b10900b0019129c7aa96mr695236plr.22.1671440838054; Mon, 19 Dec 2022 01:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671440838; cv=none; d=google.com; s=arc-20160816; b=aNdWs1cx7PM4SMF0aCw2XDEZqvbNAAK6jvKy52+tFUlfZ1uW6UwfVB6M75hKz25wQu ekQqdmGW8dGddFbbsRaLPJmJsFAkxnOusTSNddbsyCsO/u8aAEiK0fDGvH532vyvXcIJ Zt4PAF6GaKSSYunacyx/jQgHDwoONu7LtaNNmXcyubJLkrVhH74s5x3aG5GWBOqZJE1P W1QWns/CcDPVVokbIPZpbkFjuH+WwfGXvfKPV0/Rm/7Fj2lxxWyWXuPGbyyoCQqRtt2D lboXoOD32Xf/SifZObgM8RKb5PptvsyzH7x0fB6mRIEg00uNMf4TOCbbzemyRii2Osgx iqLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SEgPCMOuM3toHAMRnPEv0nKP/n56PHLERtNl5qSP27Y=; b=Ion3pevovg4OBl/I0yTP5GMI1DSut6pIXWx5an4pPgYCe9dYLfVa/g7P+XJJmaZYwN UhBHnC2OMp2YoMjMsTVVwSS709fz5mcUP5/qjsHJ76m2D1wzpAgmPKNefV3skwQ9zw79 4alqeqYTYwsFDtxf4hCVwdMovy+aeydLQYc6re8/NaZ6agzup5TEWyHsSjhWtrFF9nG6 0GXt5m4bMJ4FHeacz1qDk4ax2pvZPgvH7F6dHj8oKZYO+gr9aXfO0/Am28SRSSX9tCAO cTYe/ydt3/E2HgLrb1QyelDT9Qp/CIVowSXg9HQKgZ7mmI+nLLCNmUzu065VVH0vdXRv J4fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GeCE1XpH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a17090270c600b00189d6969658si9423206plt.342.2022.12.19.01.07.09; Mon, 19 Dec 2022 01:07:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GeCE1XpH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231277AbiLSIHj (ORCPT + 70 others); Mon, 19 Dec 2022 03:07:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbiLSIHf (ORCPT ); Mon, 19 Dec 2022 03:07:35 -0500 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6235F62DB for ; Mon, 19 Dec 2022 00:07:34 -0800 (PST) Received: by mail-qk1-x735.google.com with SMTP id a25so3377085qkl.12 for ; Mon, 19 Dec 2022 00:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SEgPCMOuM3toHAMRnPEv0nKP/n56PHLERtNl5qSP27Y=; b=GeCE1XpHOPsjmhot1alfGm10UwZR8WweYcK7Ys0ml6q0SKl29iSB4V/YGoLSd4bF1D k/gNkETnjVkPJ3Mu1VpAF8eFG5GiSNeo69v3wu2KtdmT4uHcvtB1BF5MN9dPZFmdphob 1mLvk0O3KpQe0zjxF6uDeaTIgsHmR8OuHDTH08g4AUFwm1wAsHiRLxiWMjfR8b1Dt2bt iyWWQAJD+eRSch1JqaY7QuT/BfK6poPY9PQY9D0PW4C07QFqWjcRmkGZNLBGT1Q6HBOs oyx07AoRsJLtXSd2iqJrF0eHZPK97da/C0T3ywoEpIBiJqNzLY4mwLdMjx05xon0pZLw nANw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SEgPCMOuM3toHAMRnPEv0nKP/n56PHLERtNl5qSP27Y=; b=rGG2XOw/hF34DN1Tn4fl9TORsee7zNTwJrUSocEPGhzZTV9Yb94w2/F9M7hB38OtqZ nR8D8FVCoHQ9TpMBTSB88fo7ceAK9bvH487tm00FO6OM7mxNW6WQPnKifER4zprp62Ee X6mSKySUIvn673iUOQfiVwZUar5V7Fw6GAsjk9noPQAd+eZS+JZmpAjp+U1fQWmX252n QdkUJAZh1KBHucsvJ4zibri+kkYl6xIPPnnoa6MgNAoqAiQuIhGSzniD9bQyqgXx/yLG glIm6Jn27whoilMIuSm+nHUjKwPScKAoj62KiaaXoP/H0iIwYzd+oQi6jX+YHFbToVJt Czdg== X-Gm-Message-State: ANoB5pn0O/7g27km/F1SLg63a5lNEmVsNV6qFqC0mLiD602b6d2+zr3Z Eg8Y5UhcaYjCn2yB/qiLOu1IoNzLhmP66xJre42cUA== X-Received: by 2002:a05:620a:8109:b0:6ff:a7f1:ff4e with SMTP id os9-20020a05620a810900b006ffa7f1ff4emr752607qkn.292.1671437253480; Mon, 19 Dec 2022 00:07:33 -0800 (PST) MIME-Version: 1.0 References: <20190719140000.31694-1-juri.lelli@redhat.com> <20190719140000.31694-4-juri.lelli@redhat.com> <20221216233501.gh6m75e7s66dmjgo@airbuntu> In-Reply-To: <20221216233501.gh6m75e7s66dmjgo@airbuntu> From: Vincent Guittot Date: Mon, 19 Dec 2022 09:07:21 +0100 Message-ID: Subject: Re: [PATCH v9 3/8] cpuset: Rebuild root domain deadline accounting information To: Qais Yousef Cc: Juri Lelli , peterz@infradead.org, mingo@redhat.com, rostedt@goodmis.org, tj@kernel.org, linux-kernel@vger.kernel.org, luca.abeni@santannapisa.it, claudio@evidence.eu.com, tommaso.cucinotta@santannapisa.it, bristot@redhat.com, mathieu.poirier@linaro.org, lizefan@huawei.com, longman@redhat.com, dietmar.eggemann@arm.com, cgroups@vger.kernel.org, Wei Wang , Rick Yiu , Quentin Perret Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 17 Dec 2022 at 00:35, Qais Yousef wrote: > > Hi > > On 07/19/19 15:59, Juri Lelli wrote: > > When the topology of root domains is modified by CPUset or CPUhotplug > > operations information about the current deadline bandwidth held in the > > root domain is lost. > > > > This patch addresses the issue by recalculating the lost deadline > > bandwidth information by circling through the deadline tasks held in > > CPUsets and adding their current load to the root domain they are > > associated with. > > > > Signed-off-by: Mathieu Poirier > > Signed-off-by: Juri Lelli > > --- > > We see that rebuild_root_domain() can take 10+ ms (I get a max of 20ms quite > consistently) on suspend/resume. > > Do we actually need to rebuild_root_domain() if we're going through > a suspend/resume cycle? During suspend to ram, there are cpus hotplug operation but If you use suspend to idle, you will skip cpus hotplug operation and its associated rebuild. > > ie: would something like the below make sense? We'd skip this logic if > cpuhp_tasks_frozen is set which indicates it's not a real hotplug operation but > we're suspending/resuming. > > > Cheers > > -- > Qais Yousef > > > --->8--- > > > From 4cfd50960ad872c5eb810ad3038eaf840bab5182 Mon Sep 17 00:00:00 2001 > From: Qais Yousef > Date: Tue, 29 Nov 2022 19:01:52 +0000 > Subject: [PATCH] sched: cpuset: Don't rebuild sched domains on suspend-resume > > Commit f9a25f776d78 ("cpusets: Rebuild root domain deadline accounting information") > enabled rebuilding sched domain on cpuset and hotplug operations to > correct deadline accounting. > > Rebuilding sched domain is a slow operation and we see 10+ ms delays > on suspend-resume because of that. > > Since nothing is expected to change on suspend-resume operation; skip > rebuilding the sched domains to regain some of the time lost. > > Debugged-by: Rick Yiu > Signed-off-by: Qais Yousef (Google) > --- > kernel/cgroup/cpuset.c | 6 ++++++ > kernel/sched/deadline.c | 3 +++ > 2 files changed, 9 insertions(+) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index b474289c15b8..2ff68d625b7b 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -1067,6 +1067,9 @@ static void update_tasks_root_domain(struct cpuset *cs) > struct css_task_iter it; > struct task_struct *task; > > + if (cpuhp_tasks_frozen) > + return; > + > css_task_iter_start(&cs->css, 0, &it); > > while ((task = css_task_iter_next(&it))) > @@ -1084,6 +1087,9 @@ static void rebuild_root_domains(void) > lockdep_assert_cpus_held(); > lockdep_assert_held(&sched_domains_mutex); > > + if (cpuhp_tasks_frozen) > + return; > + > rcu_read_lock(); > > /* > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index 0d97d54276cc..42c1143a3956 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c > @@ -2575,6 +2575,9 @@ void dl_clear_root_domain(struct root_domain *rd) > { > unsigned long flags; > > + if (cpuhp_tasks_frozen) > + return; > + > raw_spin_lock_irqsave(&rd->dl_bw.lock, flags); > rd->dl_bw.total_bw = 0; > raw_spin_unlock_irqrestore(&rd->dl_bw.lock, flags); > -- > 2.25.1 >