From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C85649620; Tue, 19 Aug 2025 09:29:03 +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=1755595744; cv=none; b=Ry1blxKnPuBCT9aRPBCmy2w0ww3Xxx4xWfPPwhiEiP1cVN9co3m/NZHMtRe1WPjRZ1gIcmRPVHz1UuBDt6wviZl8m1hv+hqf3eBMyNG/KMyexJPKk3xxoe822CAJEQATmiaFo7IeNMAR79J1GOnzL492RgqSyChCQygWvBwdBPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755595744; c=relaxed/simple; bh=HC67VCKp4weH+jjL5hqx09tRarh00wXR51NIPJTTfzU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I80p+a+gI8u9iADDyPXpytIg9kUmPRZGxqFNz4S4RA9rpJ9k9uuo+NBx5Z03R5kTF3/eI9EC+NS55337jYFDaJjnnR+hE6PFFyoZbcvYdnFjN7CiH9Sk2ndnA0bmZ7M3xUrY0piKe9kqIzbWmNe62u1E58V/Oj7Biy9PtWW9MzU= 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 26E211BD0; Tue, 19 Aug 2025 02:28:54 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 274AF3F58B; Tue, 19 Aug 2025 02:28:59 -0700 (PDT) Date: Tue, 19 Aug 2025 11:28:38 +0200 From: Beata Michalska To: Prashant Malani Cc: Yang Shi , open list , "open list:CPU FREQUENCY SCALING FRAMEWORK" , "Rafael J. Wysocki" , Viresh Kumar , Catalin Marinas , Ionela Voinescu Subject: Re: [PATCH] cpufreq: CPPC: Increase delay between perf counter reads Message-ID: References: <20250730220812.53098-1-pmalani@google.com> <8252b1e6-5d13-4f26-8aa3-30e841639e10@os.amperecomputing.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Aug 05, 2025 at 06:00:09PM -0700, Prashant Malani wrote: > Thanks Yang, > > On Tue, 5 Aug 2025 at 17:26, Yang Shi wrote: > > Thank you for cc'ing me the patch. I posted the similar patch ago and > > had some discussion on the mailing list. Then someone else from ARM > > pursued a different way to solve it. But I didn't follow very closely. > > If I remember correctly, a new sysfs interface, called cpuinfo_avg_freq > > was added. It should be the preferred way to get cpu frequency. Please > > see > > https://github.com/torvalds/linux/commit/fbb4a4759b541d09ebb8e391d5fa7f9a5a0cad61. > > > > Added Beata Michalska in the loop too, who is the author of the patch. > > Please feel free to correct me, if I'm wrong. > > Thanks for the additional context. Yeah, the issue is that : > - The new sysfs node is sampling period is too long (20ms) [1] > That makes it problematic for userspace use cases, so we need something > which takes less time. That actually specifies the duration, for which the most recently acquired sample is considered valid. Sampling is tick-based. > - The central accuracy issue behind cpuinfo_cur_freq still needs to be handled. I'd really discourage increasing the sampling period for cppc. --- BR Beata > > [1] https://elixir.bootlin.com/linux/v6.16/source/arch/arm64/kernel/topology.c#L283 > > > -- > -Prashant