Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2357847rdb; Mon, 5 Feb 2024 04:19:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0gSNE3IY91kHYTiCMOx7g8uILxml1ENGhRDMd5+YtBr3sSEgOudscpulQprdJHJ2KzKOF X-Received: by 2002:a05:6358:27a3:b0:175:ed25:d44d with SMTP id l35-20020a05635827a300b00175ed25d44dmr4938600rwb.9.1707135543269; Mon, 05 Feb 2024 04:19:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707135543; cv=pass; d=google.com; s=arc-20160816; b=nQc5NsM4rnqSKzhQt9Jtgh+NQkvUZGFc572QglokMHhfLX8sJ1wQa9P1rAJDsptqcr 1voUjwAK8rxM4bQ+qO3vE4KNgbFWn2zHOFrGkQrlqySVAxEW+pIIWgrikeYz4wgNcA3K 1sJ6uAsW5VOrd0gkURjxDCldu+ExxtmKq3yd+o5vLyR5Rqzfoz1LnStOE6uXa7ALg/nQ ByQy6iRFDINPQTahw6WrhsRjVo4ngCNcxkO3kvF9MQyMftr0lgYqJSh+gsTzIw8EmIwn tXDimpedS2Q2tQmDjgRLCDlJbD/lqhm4DZqWCLf+LzqypGU1ggKCsuiZKDGGzroXex9t mq8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tNUTLRh0uORxgdvQZdWeV7OWpCRm6fjT9p0GI9ATEAA=; fh=uaL7kaT+vkpM1hDAdITlgrRglF2YJMROdoz5ThJjhNg=; b=ZHq8X9V/kSwdY3vvAlXH5LXHhZcolaynf5/tFL+Z8ABBTS2s8hw5CrTGvEwS6EMw6V AHUPRaDUOAKPrNL20OaVUe5iMeziDmIZCRY4xFPuMeGjkN0tPauCLoIt6ayyfaavlS+a xVXX/wE4lKi5gwxyyvV1rqMptomYcXcd6r8ApCYqBI+Ncj8S3hJOJq/X71cAp9jfck3L wuhRs4GFAGlMROfShCYvUU/UOY0YO++rjB6gSAGZvn8iC46GRy1Uh+RdcLWml9fHdAX4 rpPaKjjnZGZ+LCr4MWXgp9d15gpdqPduLc+L8Z6ORjVXGz+KaTZLW0Ely2P05TlcEO+b NNLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b="ENQ3x8O/"; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-52540-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52540-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCWTSmTcLeRQLCg42L3g9e2exqtgX5rQJxjdWgh+HklAtSHnOoF5VZSQfLYDPF0u0bjz9BAb0VJdlVMfMMWP/riYXTgQiiFEqLPlM2NZ9Q== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w12-20020a65410c000000b005dbec9faad0si6122455pgp.408.2024.02.05.04.19.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 04:19:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52540-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b="ENQ3x8O/"; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-52540-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52540-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6D58FB217FB for ; Mon, 5 Feb 2024 12:02:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C3F21A587; Mon, 5 Feb 2024 12:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b="ENQ3x8O/" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1742168B9 for ; Mon, 5 Feb 2024 12:01:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707134513; cv=none; b=CMULrrKa/5mzypBwtoKeW1qDheJADEV6UOHF4opnOdRY19EfTFFoy0057vx0T2nP5LnzKOdHFP1s1KgxvH6l+iPAUxx9jLXGdedB2k6VEAgg6NzSeCeiSNBBZtpGVv0mQQj2Zo6lX9Odc2FQFz9R1lkjtoAYJslffTV0k/DfttA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707134513; c=relaxed/simple; bh=wy0r1UGOlI8VWUg4o5WQ5eNOjowjM5g7AjUKiiYZx5k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Cu7QHOyDQzo7SJz0zx520M/2y/QOGVHamlLGIslU/YwUQkgIvolW1p8R0hSooUbYZGrXVF1D31B4RmbWdKAmq+CsZAiTZrFFdybotkng+wIpNQWrkm6B7Mz7lCaoBcjyzLihUzmDMxo7Bt4MoW6ssMCBZwS8UrywKcHAXXwscYU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io; spf=pass smtp.mailfrom=layalina.io; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b=ENQ3x8O/; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=layalina.io Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40fc654a718so25425545e9.2 for ; Mon, 05 Feb 2024 04:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1707134510; x=1707739310; darn=vger.kernel.org; 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=tNUTLRh0uORxgdvQZdWeV7OWpCRm6fjT9p0GI9ATEAA=; b=ENQ3x8O/fiJMJymc7LxtJbwj6H2YWeJcVdeqE44iu1CcFRielLkqV+391oEqW638z+ fUa4wgm5UzTtIbd5UzWMWwTRcfjs5eaDVrUSFurjGfULmPrUxpvaty+mgwATNA0kS3Wa Wej6g3i1rHcVtkYNl8igq0GoOzz54iJ9hVRrPbpore4/Hg1LR7I3+UIfl8h9XcQPTVDH PNjtqbx51WZs9sRKdSO6rIk5k4YLF6GxXsFquBCzPV7dtwTMdrSTaZTISonp1xTRthL/ p8CpFLvGtnUBeIDZVLeBB0pSlluelcv48HJYlrfWYgQCve8bUFacNrKg3CvJ9sOv6Hvf q6nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707134510; x=1707739310; 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=tNUTLRh0uORxgdvQZdWeV7OWpCRm6fjT9p0GI9ATEAA=; b=wYrpZyDZfd2FDV/qYqce+64JsX6l52vPX6M6nFt4l9NgUWtKYEfxKdjY1W+84Z7/9S fPV4f4tHD6xohGUQI00c/RMtAwewimMEFJj2acN0SyyAHxOfFUFr70f6t1ZbcVCdnEqz ogc0vcRlrgDoSShiGg7sFH+Ig8WZbNNoYQv31BA3rB0gEiGwz5nmk+JMxLUXjlR46KGV z29rH1uKAbnuf6MwwWtxqH8XLAb5rssU/mxwWs3uwVMDB/hMSwzJqHl25urVE0jq7LKF 3xVGbIiBSELXqi+rNRm6eeygWerxReBuXEsvH36WlD/x46wJmk3XCpwjbOIk4MDPaGqb 8nmA== X-Gm-Message-State: AOJu0YxKUqKw43WN56q9yUd+fLNgoTLMbGrJDnOtnbPYLi5XYWwImFlo ahRlTLhFlaxATNFmopJQ+tVsuq87mLIuQvkgHUglgfnItkuFn37OBathhjdFMOs= X-Received: by 2002:a05:600c:468d:b0:40f:dc51:1882 with SMTP id p13-20020a05600c468d00b0040fdc511882mr1359629wmo.8.1707134509374; Mon, 05 Feb 2024 04:01:49 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCW/WeIZaLbIJdUoV2uOi8CtBU7/5uQmbaWjHK4eakyFqOpEUCrvdBLgh2S2jHCdZy4hHmXTSyLfDp3sPFiKh0OdaarA0eYJCMhAlhqZu4IQfYCllpkzEk5vYraCS8T22HotTdcAof9isywvzsSdX9zQZloV3Yfh0+nDo8/T1braAwGHp3UZTuqLGBpaR6dCfAmehzNbHMk3QO7jmUYOrnffOibWHzlCR5Cz0u2WgOij4byGlTla5J3h/I2N/DxDqzXsEh+P2aKYvSWTJY9yXKqSkucoXGVkMorC+q3i9Q== Received: from airbuntu (host109-154-238-234.range109-154.btcentralplus.com. [109.154.238.234]) by smtp.gmail.com with ESMTPSA id u20-20020a05600c139400b0040ee0abd8f1sm8382027wmf.21.2024.02.05.04.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 04:01:48 -0800 (PST) Date: Mon, 5 Feb 2024 12:01:47 +0000 From: Qais Yousef To: Christian Loehle Cc: "Rafael J. Wysocki" , Viresh Kumar , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann Subject: Re: [PATCH] cpufreq: Change default transition delay to 2ms Message-ID: <20240205120147.ui5zab2b2j4looex@airbuntu> References: <20240205022500.2232124-1-qyousef@layalina.io> <326b568d-d460-4a69-9336-28da328ffdcf@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <326b568d-d460-4a69-9336-28da328ffdcf@arm.com> Hi Christian On 02/05/24 09:17, Christian Loehle wrote: > On 05/02/2024 02:25, Qais Yousef wrote: > > 10ms is too high for today's hardware, even low end ones. This default > > end up being used a lot on Arm machines at least. Pine64, mac mini and > > pixel 6 all end up with 10ms rate_limit_us when using schedutil, and > > it's too high for all of them. > > > > Change the default to 2ms which should be 'pessimistic' enough for worst > > case scenario, but not too high for platforms with fast DVFS hardware. > > > > Signed-off-by: Qais Yousef > > --- > > drivers/cpufreq/cpufreq.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > > index 44db4f59c4cc..8207f7294cb6 100644 > > --- a/drivers/cpufreq/cpufreq.c > > +++ b/drivers/cpufreq/cpufreq.c > > @@ -582,11 +582,11 @@ unsigned int cpufreq_policy_transition_delay_us(struct cpufreq_policy *policy) > > * for platforms where transition_latency is in milliseconds, it > > * ends up giving unrealistic values. > > * > > - * Cap the default transition delay to 10 ms, which seems to be > > + * Cap the default transition delay to 2 ms, which seems to be > > * a reasonable amount of time after which we should reevaluate > > * the frequency. > > */ > > - return min(latency * LATENCY_MULTIPLIER, (unsigned int)10000); > > + return min(latency * LATENCY_MULTIPLIER, (unsigned int)(2*MSEC_PER_SEC)); > > } > > > > return LATENCY_MULTIPLIER; > > Hi Qais, > as previously mentioned I'm working on improving iowait boost and while I'm not against > this patch per se it does make iowait boosting more aggressive. ((Doubling limited by rate_limit_us) > Since the boost is often applied when not useful (for Android e.g. periodic f2fs writebacks), > this might have some side effects. Please give me a couple of days for verifying any impact, > or did you do that already? I don't understand the concern, could you elaborate more please? Products already ship with 500us and 1ms which is lower than this 2ms. On my AMD desktop it is already 1ms. And I think I've seen Intel systems defaulting to 500us or something low too. Ideally cpufreq drivers should set policy->transition_delay_us; so this path is taken if the driver didn't populate that. Which seems to be more common than I'd like tbh. I never run with 10ms. It's too slow. But I had several tests in the past against 2ms posted for those margin and removal of uclamp-max aggregation series. Anyway. I ran PCMark storage on Pixel 6 (running mainlinish kernel) and I see 10ms: 27600 2ms: 29750 HTH Cheers -- Qais Yousef