Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3623456rwb; Fri, 16 Dec 2022 18:48:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf4V5k/+IDvcIPsjXHIv6j31g/n95DApWFSO13oEqo1pmmRPBRU9Ruw+TDdbAhmqYsozlCF7 X-Received: by 2002:a05:6a20:6f0e:b0:a6:f26b:558 with SMTP id gt14-20020a056a206f0e00b000a6f26b0558mr37789406pzb.16.1671245329141; Fri, 16 Dec 2022 18:48:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671245329; cv=none; d=google.com; s=arc-20160816; b=s7KajyyM2lE9ekAY13TdfGwSHdPL6ghkQtYuvJ3XwvVQ9cHmVIAt+Yd6eNg7m5Tvt0 cUyJcJ2uE32JIokYp1x5sMqzutYCOlVInveyg/SW+Lw6EoSHKppN9xNAPnV66PFiQgjZ iDcHoU6CUtvr1XluSLZHFwFic9RbYATD7AxX6bVQ1HR2UoiKoSvBMfXrnI0LNk+LUcAi SA2t4hxyJ8XySt53q5UABMNXdmVVkMrfUQsbH8F0pCmnQ9A5l23I3FEzT7LWxsuOfw3G dI05+5IccCUqrRuJ8yZ79ZTDSGpHwQP/GzdumK6DFGvW6JrFB70YSWtdGBRfrZn3i3r2 YPxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Ji+gytidbXOMWyPvLX4LLTm6QX/OlsVTfQzF/90xBXs=; b=OsVY9Y2TbhqTjoMu4Rgj1qQcSs/VT9CtcaB7dAAdy8obxjj+2Qe3Nch6bhfQ/E6nuR 32wJf1MrN5a8yobT+tFzZiZjahfENvsiZkF8igYgZxt+FQfqH+wrTnW9Xxcn+a+YxHpI hvqcYqdRVcIHHXDztNOI4l257PCVRg1ElwxLtHL2yu3x8sNBqdUKvRVUIyuaL2I+QIfC EWWbcXREZIsJhBVtwVCCMvkw3vRV5aRZhAHVN3mN8q+nsBIXYyxbzZ+L5rU+VUnS2Th3 SkrbHZ2apLnt6WQoco5FNgzYkGKry9zT3b58FyQni9glGbenzcG1XEiIS1oL52Cv49Y+ yn6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MQUzWNwq; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h127-20020a636c85000000b00461f71a53e1si4281710pgc.505.2022.12.16.18.48.40; Fri, 16 Dec 2022 18:48:49 -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=@redhat.com header.s=mimecast20190719 header.b=MQUzWNwq; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbiLQC1P (ORCPT + 70 others); Fri, 16 Dec 2022 21:27:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiLQC1M (ORCPT ); Fri, 16 Dec 2022 21:27:12 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C45433D91C for ; Fri, 16 Dec 2022 18:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671243986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ji+gytidbXOMWyPvLX4LLTm6QX/OlsVTfQzF/90xBXs=; b=MQUzWNwqSDFdcvhuOhH5nc0Vx2yCN45Tyc2Z+oxaebNQ5ZwWjBseFA3QPMmm/BPeEcXz3m iLaH+wE2RCPknkJBV0wtOCEf3hSCxIo0b9BX0c93cBidkTKNYaYbZxvACZbM+L/pAOvEH2 LSj2J43UyoNS5cY3HpzVG9LbvulP784= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-OfgwyDBZMqah10-vzCPlwA-1; Fri, 16 Dec 2022 21:26:23 -0500 X-MC-Unique: OfgwyDBZMqah10-vzCPlwA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7F7D685C6E0; Sat, 17 Dec 2022 02:26:22 +0000 (UTC) Received: from [10.22.8.73] (unknown [10.22.8.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FB7A40C2064; Sat, 17 Dec 2022 02:26:20 +0000 (UTC) Message-ID: Date: Fri, 16 Dec 2022 21:26:20 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v9 3/8] cpuset: Rebuild root domain deadline accounting information Content-Language: en-US To: Qais Yousef , Juri Lelli Cc: 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, dietmar.eggemann@arm.com, cgroups@vger.kernel.org, Vincent Guittot , Wei Wang , Rick Yiu , Quentin Perret References: <20190719140000.31694-1-juri.lelli@redhat.com> <20190719140000.31694-4-juri.lelli@redhat.com> <20221216233501.gh6m75e7s66dmjgo@airbuntu> From: Waiman Long In-Reply-To: <20221216233501.gh6m75e7s66dmjgo@airbuntu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 12/16/22 18: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? > > 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(); > > /* rebuild_root_domains() is the only caller of update_tasks_root_domain(). So the first hunk is redundant as update_tasks_root_domain() won't be called when cpuhp_tasks_frozen is set. Cheers, Longman