Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp241379lqt; Thu, 6 Jun 2024 02:05:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoF5yoC9nzOOOm3gT76tN6ZBzvUS36mRKcZleAnJ/N3/Ttx/fbjOef7Ne4qgcULtMGoqBfUAclTReIvXelnruDZ2SLXA28KFJe1UUWag== X-Google-Smtp-Source: AGHT+IGozEGJ1eea3c6RN5lBYY8To6OJjQjPhxGDUf+nmHnX7lFAYHAFigXV0TvOTsdxizXi9yiW X-Received: by 2002:a05:6214:5c09:b0:6af:bc71:828b with SMTP id 6a1803df08f44-6b030a8a88amr47393496d6.58.1717664744377; Thu, 06 Jun 2024 02:05:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717664744; cv=pass; d=google.com; s=arc-20160816; b=Ddvvs7LEUk/Z/+VGbgqmHrWAZTw/jiEG63erm5zjJV5bvh6xm7+nTDcYHjexyMTWSo tvEfpPAxINIKBUmciT0TR8d/BnqU9K+r+nJzdLxd4UmF0wqistRQbOmskYHdzxtMz0QJ We0M4/TMPA7KI6V8UsGkrZZFKYMj2JS2+ujdWFGNnY4hSR0hoveRe5MsUoRnPCVZiTkK TUgxcTkiZxQGYA1AN7zcIo1z7OpKLCNi15nwWjqK7sjtKUaUCofdF3kuY9kBoACbLmiM hqXpgqBsKera//BIfdj9uJcN/5ar9UYCkqW2EGLzTKgk21DGe5xs7HLsn7ULwuoTWllA ZZvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=EYxRTlknPt1rwwF6FbBHmR4IU0NEbwv646qOvagX2vY=; fh=GPlquE77/S3b4C9fO90iprJj+9gU4YTMgqpxD3SPTHY=; b=CCXbjsmTfo3eiD6c6Z7OSMKEiH2w3hoy5+wd+Oo1gwrBZuU54CF3+C6mCZuZVipcOq s1slhAevX4sRJBStQWWggFyLK7kUtC5qJoOBuOdSV3SBfNEZHSbqPjVbc4CBDYBYj/GL 3MlnEUMrl1aPyAaHzO9x460zsZ/YpU2lBTkV8O96wxNus92dFbcBQm+KQIFxkO+ymsx4 L0GvLd9grRZuJI7IgG6SyRN9X4J2QeHe/lZj9CQuezSRJ8mtysJQZ0Zj2E3PMCXId9fc EjYSIIJVLcB1IBgowalRmZiB75r89QjZjmobIZ1gtmGtXZj2GzfREGzQyWCUIt7cDZK9 I3oA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-203922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04fa1e521si10496166d6.472.2024.06.06.02.05.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:05:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-203922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1CEBC1C257E0 for ; Thu, 6 Jun 2024 09:05:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A097714EC5C; Thu, 6 Jun 2024 09:01:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D0F713D2A0; Thu, 6 Jun 2024 09:01:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664478; cv=none; b=cHC0fo7mqU9czQcbTTWj/zd2VPPeDwGyhzPriKTwXKfI4kjheISjSECp+xs57EdJWKaLLaQfpSaKcbo+bKnJ2MJwbp6SR4XX7xkU7gh1CxM8GVPRJqDFRt8ChR1cY9pRZwsjPWt2pH8Ddni7zIEAHooXAGJQWYMSbJnhm3YubPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664478; c=relaxed/simple; bh=gPB/hPlo8TMgrOoFRBHzJovmHAJH3zJeXXoyccgpjsk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=E0pRyPRTPCSbtEk5w88fX/InWjhK/ecHWed8ICe55RzCpmng0UQJ223lAtURh9lb4/Ht9/5JwD/akRnMf2EO480jN3edRvOWz9fcgdi63knWvEit0B6h9+slY6bx7QQ3/PWP1C0AnLNhhEH7r0KFqrH9EhGbhwF/CeHAP8XC6ps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 602CC339; Thu, 6 Jun 2024 02:01:40 -0700 (PDT) Received: from e127648.arm.com (unknown [10.57.71.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3D6D73F762; Thu, 6 Jun 2024 02:01:13 -0700 (PDT) From: Christian Loehle To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org Cc: vincent.guittot@linaro.org, qyousef@layalina.io, peterz@infradead.org, daniel.lezcano@linaro.org, anna-maria@linutronix.de, kajetan.puchalski@arm.com, lukasz.luba@arm.com, dietmar.eggemann@arm.com, Christian Loehle Subject: [PATCH 1/6] cpuidle: teo: Increase util-threshold Date: Thu, 6 Jun 2024 10:00:45 +0100 Message-Id: <20240606090050.327614-2-christian.loehle@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240606090050.327614-1-christian.loehle@arm.com> References: <20240606090050.327614-1-christian.loehle@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Increase the util-threshold by a lot as it was low enough for some minor load to always be active, especially on smaller CPUs. For small cap CPUs (Pixel6) the util threshold is as low as 1. For CPUs of capacity <64 it is 0. So ensure it is at a minimum, too. Fixes: 9ce0f7c4bc64 ("cpuidle: teo: Introduce util-awareness") Reported-by: Qais Yousef Reported-by: Vincent Guittot Suggested-by: Kajetan Puchalski Signed-off-by: Christian Loehle --- drivers/cpuidle/governors/teo.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c index 7244f71c59c5..45f43e2ee02d 100644 --- a/drivers/cpuidle/governors/teo.c +++ b/drivers/cpuidle/governors/teo.c @@ -146,13 +146,11 @@ * The number of bits to shift the CPU's capacity by in order to determine * the utilized threshold. * - * 6 was chosen based on testing as the number that achieved the best balance - * of power and performance on average. - * * The resulting threshold is high enough to not be triggered by background - * noise and low enough to react quickly when activity starts to ramp up. + * noise. */ -#define UTIL_THRESHOLD_SHIFT 6 +#define UTIL_THRESHOLD_SHIFT 2 +#define UTIL_THRESHOLD_MIN 50 /* * The PULSE value is added to metrics when they grow and the DECAY_SHIFT value @@ -671,7 +669,8 @@ static int teo_enable_device(struct cpuidle_driver *drv, int i; memset(cpu_data, 0, sizeof(*cpu_data)); - cpu_data->util_threshold = max_capacity >> UTIL_THRESHOLD_SHIFT; + cpu_data->util_threshold = max(UTIL_THRESHOLD_MIN, + max_capacity >> UTIL_THRESHOLD_SHIFT); for (i = 0; i < NR_RECENT; i++) cpu_data->recent_idx[i] = -1; -- 2.34.1