Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp241558lqt; Thu, 6 Jun 2024 02:06:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU07AkueKIDAz2xRGcFzA1lzKJIcJNQCbz+D3ee7yZEzVl8y2xZMEqUQUSnsQe5a3X4EJBPkTTaXscwXnYVpH0/zz49WxO2FjHNb4u5JQ== X-Google-Smtp-Source: AGHT+IGoiHalLbj9iKBcLkpcpgMTGSasVh5H3qALHaqM71d9KDe2BUdXtPoK4oBw4oDxhnYWeGTV X-Received: by 2002:a05:6214:4506:b0:6a9:8226:2672 with SMTP id 6a1803df08f44-6b02bf1eed1mr54746236d6.18.1717664765649; Thu, 06 Jun 2024 02:06:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717664765; cv=pass; d=google.com; s=arc-20160816; b=IaKawV0pBhOq4v7x7/NTahkPUZ0Lqk4/S7TAo3MraffwZDAm0HTF52dwXnp2oxRxPX Tzrzmmq1Iw9nYNUmjyw+NwWvPXUcIr4b1ave7ookLDOysUBvMLpJROVKc+P87A4N7/0T U0ke8ictsMSJ73SehhoPM5Nv3bdfflnLyrQ0MzK+F7zYEuY7k+2J0rkR7p9DfHAls7HJ tz1tUbDzfDhe9qCDm2XeUJIscZ/TPE23QXHGIxCtZhz4wjVmInlGFUkCxf3tgGEXY194 0srkdtbU8QSS/hHNaLZo/zAxzH7U4cpY6mSDQ+ko1UkUW81IcKtsc+LLQ08nLTwbtPN/ 3g1Q== 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=7fw/xKYYjW04ibK4ai3VuswKUrjU4E+GsW9AYOF3zXY=; fh=GPlquE77/S3b4C9fO90iprJj+9gU4YTMgqpxD3SPTHY=; b=uTGtuCAGdnrEBhErRBjKTG4YOgiRlrNqxDkJKiS9EUSi/u7qswJfJY/zo7m4tfkIeJ KPwmg6Das8d9YnuXy6oFSwIhhmIzJeTbJfj+NnJM6ODewordXwYxwKMDMyjYBGKIyPq7 BH5l18NLEdivyBUzHdiJvePGD0zZ5kI0xQcuLwtDShtWxqY8aLy7felm3Pwhy31PSn1Q KfN7iqLeRnhWK3oAoncUmHUUu8zv0UzDivlHHTPdVz7/t7xCculUSiZrsWeKLFH3G3q4 dSaCWhnu8BkHwPPFTEqcuMoZFLAcoG/TDLgTB0DtlMXS+JYnebys6/nz7vnCL4Gm4HaF GNSA==; 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-203924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203924-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-6b04f63c7desi10254786d6.21.2024.06.06.02.06.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:06:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203924-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-203924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203924-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 5FEBA1C25881 for ; Thu, 6 Jun 2024 09:06:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC0C514F135; Thu, 6 Jun 2024 09:01:22 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01BBE13AA5E; Thu, 6 Jun 2024 09:01:20 +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=1717664482; cv=none; b=Qxo9GDjJZEpYlPfJ6m6QQNQkaZtllGpO4IASmOxoFrWpnCBeND7Mn7YRspBTirSFYsi6cS+ge2y0O4Kq21EQGf7WBozbPVaB/LrxmDOcAh3fUr//rRCmxxEX/kY6lHv863XI7b6Etdxovc+1La4d9kUsFm7W/e0YlmQgw83ZuNM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664482; c=relaxed/simple; bh=qML0uzCbmFJloLReDcFy0oJJlPIuvZmfqSV9p2czb8M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qJuRhzjFIRC7I4UuW0jsA9aYVPonoC42fU8BylagLFzl+NzBd5C5yGxm+ClZ+W0gtxItmSCtWbTBs3+cIxMRW55yCcuf1snQ/c8h61bAy3+Ci5gGoIjsCHrg5vm6j5LYZFBdfQPCXft68YN4WhIc67zGce2P/AOXNkmx4td0nY0= 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 DBC38339; Thu, 6 Jun 2024 02:01:44 -0700 (PDT) Received: from e127648.arm.com (unknown [10.57.71.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E9E093F762; Thu, 6 Jun 2024 02:01:17 -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 2/6] cpuidle: teo: Don't stop tick on utilized Date: Thu, 6 Jun 2024 10:00:46 +0100 Message-Id: <20240606090050.327614-3-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 As we expect to be woken up early, stopping the tick is likely to be a waste. Signed-off-by: Christian Loehle --- drivers/cpuidle/governors/teo.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c index 45f43e2ee02d..2c427dd4cac0 100644 --- a/drivers/cpuidle/governors/teo.c +++ b/drivers/cpuidle/governors/teo.c @@ -429,10 +429,13 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, idx = 0; goto out_tick; } - /* Assume that state 1 is not a polling one and use it. */ + /* + * Assume that state 1 is not a polling one and use it, but + * don't stop the tick as we expect to be woken up early. + */ idx = 1; duration_ns = drv->states[1].target_residency_ns; - goto end; + goto out_tick_state; } /* Compute the sums of metrics for early wakeup pattern detection. */ @@ -618,6 +621,7 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, duration_ns >= TICK_NSEC) || tick_nohz_tick_stopped()) return idx; +out_tick_state: /* * The tick is not going to be stopped, so if the target residency of * the state to be returned is not within the time till the closest -- 2.34.1