Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp884794lqt; Fri, 7 Jun 2024 01:14:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjw7S4PhtDE1vOTMUFP1KbQuWbv3q4JlqUAhzyF/cmNDg4nGpnaXEaJi1F7UN85aQSQq6tN+4xr2ny4aU8IMlEEgua0zKAo3HwEbKlCQ== X-Google-Smtp-Source: AGHT+IE8VmpwnmDBr52Cy5g6aURoSvk2JmirHRv5RLHfdDAwCo41QqOBayRX0zTnvkAgrEGUTiwf X-Received: by 2002:a50:f60a:0:b0:57a:206d:b5e4 with SMTP id 4fb4d7f45d1cf-57c549edd2amr764979a12.13.1717748093345; Fri, 07 Jun 2024 01:14:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717748093; cv=pass; d=google.com; s=arc-20160816; b=XXTTbyJ5SmCx73dm8FeYSohhlC4EYnLzCRo3+dkcEe504qIUZ114SzYhNxDf0QGZJ2 rznDGK3PD+1b7Iy2L0nOwi503rR7l7hZJ9uEXBWo3/nK1dP7XwH5AuFssq9m0eXDRfOP ZhPD6a3ffu/sMEat6q5Sv16CEy0KSi3FifcsRWm24us6dkOC1XlDPT4j3Ez6bj1zCan1 CWSzoufP435FMcR2h2KarO1DLvQcbzunsyHBqV+z1LjXG5p1kFH9Z2t1AGSqdITMKXGd 6Ib1ficCG3lJ//afEisKY5vx5aZEp0kcWd/ooeUl4yA0qJRtp4/AUHhHE2l53anxS9Hp l2Mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=9tt/viuTkPACVD8fwCO7tnUaqJG04OF6A9BDwflC6DQ=; fh=0tgznX1k3x8A5jfXUePdir7iJw9zjUOLDDhEw/TcVtk=; b=H+YrRdM8GXOSNYOTo4BBy3+E5qM3ImUBJ99iCkaTP8aRVYZmRkTP0EpNakyaD9DZxA f7Wt42Q2Kp0doPDvwRLcPpbAKmTev4c4ecQkPPd9uuRfooibaBKkulRRf5e4gErywmqc DHdErc8BenfolRWlWJiB3y1hvcEX6uxWkoO4X0boqecsGEUMurun9Uc4O6TBGpAzT3Xf qjWUdVJmkU+8wFHHnxozpqKEdOADKfb00erGRyS3N2AfpfokdwK2UtyJTj5f57pw1T8Y 0egc29GZapZyvihbDWSzaSo6g53pBGGFCqlwljjF/6wLn4bV4J6HwUn98kE3MJWTquCu 7RRQ==; 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-205591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae26ad68si1628703a12.591.2024.06.07.01.14.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 01:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-205591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205591-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 082451F238F5 for ; Fri, 7 Jun 2024 08:14:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE75515ADB7; Fri, 7 Jun 2024 08:14:44 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62A1C13E043; Fri, 7 Jun 2024 08:14:42 +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=1717748084; cv=none; b=nt0M1QwO+PvDT+cMopxLCwpD2Uk/9wSalzpIvtIdA+opTuGnH4rXoBWJFgj7mBtp5k/wqIuNwqnW6U4JMP7IWSRYmBvXKkxLcuxHhGUylak3INPW7h8j8yCqTCN2cd+eDBNwPMRHbSXz0YGhEWWdgGNTgL9llwbgZS6vnA8ozRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717748084; c=relaxed/simple; bh=Lrv2JMUnu8KtktRB5CsvxnRHmeg5518CYUsd9b4ohQM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tWkqOGnb1qQVU3R3oxJeSKNVE8Y7j8I4CZibW8piwQlnA4L7lkJlvFZce72HrWUd618HJ6mLC0DyOQwUW9N//xXjKHyOqVWSF40c6xeXbVh8H+/V2LP3yU7gjgGqPpYg0ExFpYunh7+0Jw9DFv390MDfPjFt0sOa5SrKcZJqY2A= 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 3A3862F4; Fri, 7 Jun 2024 01:15:06 -0700 (PDT) Received: from [192.168.2.88] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 151483F64C; Fri, 7 Jun 2024 01:14:39 -0700 (PDT) Message-ID: Date: Fri, 7 Jun 2024 10:14:38 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/6] cpuidle: teo: Increase minimum time to stop tick To: Christian Loehle , 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 References: <20240606090050.327614-1-christian.loehle@arm.com> <20240606090050.327614-5-christian.loehle@arm.com> From: Dietmar Eggemann Content-Language: en-US In-Reply-To: <20240606090050.327614-5-christian.loehle@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 06/06/2024 11:00, Christian Loehle wrote: > Since stopping the tick isn't free, add at least some minor constant > (1ms) for the threshold to stop the tick. Sounds pretty arbitrary to me? 'duration_ns' is either based on target_residency_ns or tick_nohz_get_sleep_length() or even set to TICK_NSEC/2. Does adding 1ms makes sense to all these cases? But then why 1ms? > Signed-off-by: Christian Loehle > --- > drivers/cpuidle/governors/teo.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c > index 216d34747e3b..ca9422bbd8db 100644 > --- a/drivers/cpuidle/governors/teo.c > +++ b/drivers/cpuidle/governors/teo.c > @@ -622,10 +622,10 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, > /* > * Allow the tick to be stopped unless the selected state is a polling > * one or the expected idle duration is shorter than the tick period > - * length. > + * length plus some constant (1ms) to account for stopping it. > */ > if ((!(drv->states[idx].flags & CPUIDLE_FLAG_POLLING) && > - duration_ns >= TICK_NSEC) || tick_nohz_tick_stopped()) > + duration_ns > NSEC_PER_MSEC + TICK_NSEC) || tick_nohz_tick_stopped()) > return idx; > > out_tick_state: