[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 06/15] cpufreq: Add Hardware P-State (HWP) driver


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 31 Jul 2023 15:56:34 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b2InilYaptwCoVS5K1nDOd3A8y9sVLBW++/dx+G+cKg=; b=UL1zlYszSQ+CN7HU8QLGkvVIzvMOpK+9fBcX6PCTZdK7zLxC9MgoH3hKrecsrWQzc4uPgM+Q+1F3icFt3ZAP9N/j61CO6ghfIIet0UVW0uyWaoCsUXTo2DWEFbxIaV3rs8Jis84iQ+qWCOB0oUAgjkYyLRVICxY6AL60VrXKGnnV3AvgCEB+6VZs/bBGSudcZ393a2SyfUm8sfqskzWtUr5kY2Cp2bfp/UIV8qsbHsGh+LEVO8RvAn1paVrw0NozoBRDlGnYJEIp1K8gOJv7w15oRc30ot0hS02nR22NC+XviPmEke8KesuJuPcS+XUyjRs28mH+CJ3KmkGJO4iT1w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mpTCySQ2wtQO+jVRCJr4NKdlBfFjKztK8dc5mhb2ZglL2b/salFjSHcQ9as3IZFsBIMGqyTRwWeQ590EzHrOOX6xA9QqZiOrBdtewo4IzqEP1C0RGxnv8SNTy6FbJcGXEoGjKJpUmn6OiQxWMbeNotEUY/TnFZ3Q2jmGQpOumgwPqH/7h2PI1FNb3HBanT+bt7rF6EkbM5Mcm40YmVT+xoGB0Q1E1zmMqsNFa5qo8xssg7RalE3Ki4GbCQ2LFLhgMzZYKgVaiD3ieg3RH4Y4AXTgGMyht56BxJTyH+uqMnwcIeQXGnWh1NNMOoWevo6YOPfFcES6MZf1uG+/my58KQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 31 Jul 2023 13:57:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.07.2023 19:09, Jason Andryuk wrote:
> From the Intel SDM: "Hardware-Controlled Performance States (HWP), which
> autonomously selects performance states while utilizing OS supplied
> performance guidance hints."
> 
> Enable HWP to run in autonomous mode by poking the correct MSRs.  HWP is
> disabled by default, and cpufreq=hwp enables it.
> 
> cpufreq= parsing is expanded to allow cpufreq=hwp;xen.  This allows
> trying HWP and falling back to xen if not available.  Only hwp and xen
> are supported for this fallback feature.  hdc is a sub-option under hwp
> (i.e.  cpufreq=hwp,hdc=0) as is verbose.
> 
> There is no interface to configure - xen_sysctl_pm_op/xenpm will
> be extended to configure in subsequent patches.  It will run with the
> default values, which should be the default 0x80 (out of 0x0-0xff)
> energy/performance preference.
> 
> Unscientific powertop measurement of an mostly idle, customized OpenXT
> install:
> A 10th gen 6-core laptop showed battery discharge drop from ~9.x to
> ~7.x watts.
> A 8th gen 4-core laptop dropped from ~10 to ~9
> 
> Power usage depends on many factors, especially display brightness, but
> this does show a power saving in balanced mode when CPU utilization is
> low.
> 
> HWP isn't compatible with an external governor - it doesn't take
> explicit frequency requests.  Therefore a minimal internal governor,
> hwp, is also added as a placeholder.
> 
> While adding to the xen-command-line.pandoc entry, un-nest verbose from
> minfreq.  They are independent.
> 
> With cpufreq=hwp,verbose, HWP prints processor capabilities that are not
> used by the code, like HW_FEEDBACK.  This is done because otherwise
> there isn't a convenient way to query the information.
> 
> Xen doesn't use the HWP interrupt, so it is disabled like in the Linux
> pstate driver.
> 
> Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> +static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
> +{
> +    static union hwp_request initial_req;
> +    unsigned int cpu = policy->cpu;
> +    struct hwp_drv_data *data;
> +    static bool first_run = true;

This would probably better be __read_mostly. Iirc there were some small
adjustments requested elsewhere, so I guess I'll wait for v8 before
checking to see how much of this series is ready to go in.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.