From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CCFAC4332F for ; Fri, 16 Dec 2022 23:35:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbiLPXfb (ORCPT ); Fri, 16 Dec 2022 18:35:31 -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-Google-Smtp-Source: AMrXdXvFvrAx2wjFerv1hrGW9YLwPEWJ+CnrtJ/yL2ZcStDyiRN/YTr3lukNz8P7mAoYsh/kYqITOw== 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> 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