Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3470531rwb; Fri, 16 Dec 2022 15:45:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf5BFqGpTOqwZSIlMU8IBpeHdiVqyPGg3NEuE0YNBnvXCh8SXcjmGs8lpeFn7OUcjoeXci5F X-Received: by 2002:a05:6a20:a594:b0:ac:434:ebfe with SMTP id bc20-20020a056a20a59400b000ac0434ebfemr42853984pzb.52.1671234310312; Fri, 16 Dec 2022 15:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671234310; cv=none; d=google.com; s=arc-20160816; b=WFPJ9+dL3K6rmtUtnChK12FViBOIg7BQjc+rc9iXL1iUuRRSuc+LzhpqcAMLXl1/4K ergqWBSMSVZNiht70KGYBZOTd4DRZNZHpR8P5w0NpHj6Q4icmk1jG1KLOwDv5BS+2/RH upWUlh4zcISvkGKtzIGoK5+FCnD7yRq5oI0p0Q595bwhxP5noAacq3o9KFjLozSKzj/J P48CpvLHE6qYqb3MYDWwJmLDYJppw/zqiWMF2JdlOs6a6tIEAXaf7u+eSpI6lgNJULad YoAKr61KyhNCTCn9wKEeHrtkC/YZYM8ur1/Zuh85US1QY9FTO/ezlezsd7QYY4QBTryI cE5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X0VtzC74LzR2drrGRcJjmM7+tpdFp4NU23zKURKWjt4=; b=LPPcY9bonCGAhTlCydkHrKRDkzvuXojR+a/MBorGl0+4Xu7sGhEjGLM1zU4/syWuFl ce+74KVMXNeNzMCr+yzQZckE1Gi5G7g6kePDjxeQ36NegKhf5SwxLklAs56UqFDc9DeA 9qp/f9zjqH0qjG9Jg8X8EdWI3KSKbqzckGvTRazdoB/yOiFp0Kz2+9+ATHV6RBBotohe do85xbfzpbO1DwevEyYYgP0kNxLPmb9ESBZh1BVRBL2ppgWtUiLuWRuX6xRWOKzYOOKl JK/kdviqWRqYYgTxQlcPONExXjkUTGKUmsrlAQzYq5mMbwIrWMBq9+xRrsweb+jThwWu WfSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@layalina-io.20210112.gappssmtp.com header.s=20210112 header.b="gfzD/GKB"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a654005000000b0046f75b665b8si4307530pgp.757.2022.12.16.15.45.01; Fri, 16 Dec 2022 15:45:10 -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=@layalina-io.20210112.gappssmtp.com header.s=20210112 header.b="gfzD/GKB"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbiLPXf3 (ORCPT + 68 others); Fri, 16 Dec 2022 18:35:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbiLPXfK (ORCPT ); Fri, 16 Dec 2022 18:35:10 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02D0B72611 for ; Fri, 16 Dec 2022 15:35:04 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so2828036wms.2 for ; Fri, 16 Dec 2022 15:35:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=X0VtzC74LzR2drrGRcJjmM7+tpdFp4NU23zKURKWjt4=; b=gfzD/GKB7u5dlxmxEaH6dLYg6YiMvLoKLMxgIkMoYyeq8S3M3btEvu7gt8MXbWzZQa G6GWiXE1LS463y8W7c+a+8TF5sjpiYS1ywoBTty38GltUXu05+DWuenht2Ws/g8TvmNe iyqheFyZquS57ZRuN+238btFfCxOGFaP6xtKQvuIZQM7dyu262r+ICz2EdaTOkqOsUvd mEBFXa8jyLZeeBRo8UenQzbQSrLrGhXEOu+pLOfwZQZIuxwUoLHeco8xLOg03ZSVQVgR 2B0MKR+nQJO/RifdfQ51o4Jz8gbV7gamHgytNu5OdbfBwQEGy62XkdaDwqRwDUB8XiCI e+gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=X0VtzC74LzR2drrGRcJjmM7+tpdFp4NU23zKURKWjt4=; b=mjwXhGu1spMl1kwnx203skX8mTE290FeVyNy2ufjs8La4ORoYdF2agrO2mjsuDMh3W uD/d0ZvfZi6SudiDoULw/57jozPJFXTdK7zkDf2+eKU7qlLPNWrikpKXZdp33vwjzLId RWRm3ag5pCxK+BA8aHcmUbghVt2LrSUjRFiI0RMN29p8/KUIqBLBl83FzXlpz6P9GbLr b/PVjadH/PSBlk8lJso0WcNCmVFbfKpNqis9osQEwqxlEi7fDYdjkqvMfFTM1K8alzpu ZqVENNIUjrF92+6RdwrWN6mZRCenzqtGUheaXf/xhjFlEo4hjzy0tZ1Rdv4RPvjrd5sw QYcQ== X-Gm-Message-State: AFqh2krOFzHc22AZhm516CplFoEBG7Jfq1Z9S/xlQMwF+2zYDG+Izh6E 31lmxDIw7H0p+Ep6Nu6vamGTag== X-Received: by 2002:a05:600c:601b:b0:3d3:4cbf:3a51 with SMTP id az27-20020a05600c601b00b003d34cbf3a51mr40341wmb.14.1671233703215; Fri, 16 Dec 2022 15:35:03 -0800 (PST) Received: from airbuntu (host86-130-134-87.range86-130.btcentralplus.com. [86.130.134.87]) by smtp.gmail.com with ESMTPSA id ay14-20020a05600c1e0e00b003cfd4a50d5asm11026391wmb.34.2022.12.16.15.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 15:35:02 -0800 (PST) Date: Fri, 16 Dec 2022 23:35:01 +0000 From: Qais Yousef To: 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, longman@redhat.com, dietmar.eggemann@arm.com, cgroups@vger.kernel.org, Vincent Guittot , Wei Wang , Rick Yiu , Quentin Perret Subject: Re: [PATCH v9 3/8] cpuset: Rebuild root domain deadline accounting information Message-ID: <20221216233501.gh6m75e7s66dmjgo@airbuntu> References: <20190719140000.31694-1-juri.lelli@redhat.com> <20190719140000.31694-4-juri.lelli@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190719140000.31694-4-juri.lelli@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 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(); /* 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