Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1000673rwb; Fri, 28 Jul 2023 03:16:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlEdDiqS727LJiU3EHcJ7tkxvTrBMCc+eAdGLON2EJ7INTsJ+a61ldpmPdBIV24GwWGAkeaP X-Received: by 2002:a05:6870:c228:b0:1ba:85a1:e506 with SMTP id z40-20020a056870c22800b001ba85a1e506mr2708373oae.23.1690539395467; Fri, 28 Jul 2023 03:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690539395; cv=none; d=google.com; s=arc-20160816; b=cAemA/+0Tf9QoyMiJKwNxoxUn73cgoEkP5TZZ9Pp4ihp8kCdgrQR4ssHmKa57b820c 7YiKgGMW6IXAzSQ8aEEzP/x7/6a1OZOoIutgYSBEzG5kSBPJSCJk0W1Lu7DBsOc5fU6s W6rMQxs/yF+D+/yajRytZuu3535mZRpM8Li/XKLdkiB09BudSemD5N4Wd3MjXfvTigj9 MfurhyyIcf9n47FQmEGtPl2l/XoK9PVcYWhDwb6w4cW1zdeqlNVkiALxpfR6rk2xeBOp j5OcugiGQ3eJZcWklu3nl8hYbJteA6S6sUA5Qq2uQtu12jN8f7tEaRZSsj3/JIiXXXZ1 +nJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1yAc5WAO3db+u1yX8svTIr/fj7/+HjS/BzsPMH3x58E=; fh=vcb1WTwJPUMTZX6OxkyO+5cKBEoTRHpgQZ5gmsle4eE=; b=jNL5wa/tZTus/bAKaEmmEEG7EAQow5Dfk7pssOQtHQiHmmLOU131NqfoI5LxduSXSC XNfyEyEOFlJwdePRwmXy0+/9LBSkuoUnQMnvJTdU4ajYnNW7Ho7ELHyXtE7/aITvLewU GLISfeKijBG6cXuXHDPA+cyVsc+jOUD7R0Vqt8l6586XjxGC0VwPOu0+ydjflL5ZvlY7 ysGKHLGJobwmjQAlLVtsEGMm11nRQm/i9Igo1hzySui4jRAFeS2aVaa/1JbrTKxfKEMa z4lVvZCf9XI9kXAaXqELiP2W6+6QKtSetizakPHi9058vuJ0a4dhmUoWfmi295y5ExKb oWDw== ARC-Authentication-Results: i=1; mx.google.com; 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 dw24-20020a056a00369800b00686ea5147a9si2903282pfb.375.2023.07.28.03.16.23; Fri, 28 Jul 2023 03:16:35 -0700 (PDT) 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; 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 S235671AbjG1KC7 (ORCPT + 99 others); Fri, 28 Jul 2023 06:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233106AbjG1KC3 (ORCPT ); Fri, 28 Jul 2023 06:02:29 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2924049C4; Fri, 28 Jul 2023 03:01:58 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 392725c6ea6dcf7f; Fri, 28 Jul 2023 12:01:56 +0200 Authentication-Results: v370.home.net.pl; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=rjwysocki.net (client-ip=195.136.19.94; helo=[195.136.19.94]; envelope-from=rjw@rjwysocki.net; receiver=) Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 29317661E37; Fri, 28 Jul 2023 12:01:56 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Peter Zijlstra , Anna-Maria Behnsen , Frederic Weisbecker , Kajetan Puchalski Subject: [PATCH v2 3/3] cpuidle: teo: Drop utilized from struct teo_cpu Date: Fri, 28 Jul 2023 12:01:49 +0200 Message-ID: <8262074.T7Z3S40VBb@kreacher> In-Reply-To: <5707588.DvuYhMxLoT@kreacher> References: <5707588.DvuYhMxLoT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrieeigddvtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepphgvthgvrhiisehinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheprghnnhgrqdhmrghrihgrsehlihhnuhhtrhhonhhigidruggvpdhrtghpthhtohepfhhrvggu vghrihgtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrghjvghtrghnrdhpuhgthhgrlhhskhhisegrrhhmrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Rafael J. Wysocki Because the utilized field in struct teo_cpu is only used locally in teo_select(), replace it with a local variable in that function. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/cpuidle/governors/teo.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) Index: linux-pm/drivers/cpuidle/governors/teo.c =================================================================== --- linux-pm.orig/drivers/cpuidle/governors/teo.c +++ linux-pm/drivers/cpuidle/governors/teo.c @@ -187,7 +187,6 @@ struct teo_bin { * @next_recent_idx: Index of the next @recent_idx entry to update. * @recent_idx: Indices of bins corresponding to recent "intercepts". * @util_threshold: Threshold above which the CPU is considered utilized - * @utilized: Whether the last sleep on the CPU happened while utilized */ struct teo_cpu { s64 time_span_ns; @@ -197,7 +196,6 @@ struct teo_cpu { int next_recent_idx; int recent_idx[NR_RECENT]; unsigned long util_threshold; - bool utilized; }; static DEFINE_PER_CPU(struct teo_cpu, teo_cpus); @@ -366,6 +364,7 @@ static int teo_select(struct cpuidle_dri int idx0 = 0, idx = -1; bool alt_intercepts, alt_recent; ktime_t delta_tick; + bool cpu_utilized; s64 duration_ns; int i; @@ -390,13 +389,13 @@ static int teo_select(struct cpuidle_dri goto end; } - cpu_data->utilized = teo_cpu_is_utilized(dev->cpu, cpu_data); + cpu_utilized = teo_cpu_is_utilized(dev->cpu, cpu_data); /* * If the CPU is being utilized over the threshold and there are only 2 * states to choose from, the metrics need not be considered, so choose * the shallowest non-polling state and exit. */ - if (drv->state_count < 3 && cpu_data->utilized) { + if (drv->state_count < 3 && cpu_utilized) { /* The CPU is utilized, so assume a short idle duration. */ duration_ns = teo_middle_of_bin(0, drv); /* @@ -558,7 +557,7 @@ static int teo_select(struct cpuidle_dri * been stopped already and the shallower state's target residency is * not sufficiently large. */ - if (cpu_data->utilized) { + if (cpu_utilized) { s64 span_ns; i = teo_find_shallower_state(drv, dev, idx, duration_ns, true);