From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.46.50 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796210642; b=ALu/YyE8lV4PkwwblIwQsRXvw4dMDeWqrG2PkBkmStiSgfh2OqKf2XwV6eMumMgYASZg xehHIVEFbZSdl/cIsWo7idKyE0SM29f60Gdl7/UxZuRK9Af2TZxFSFT8bS4yJ4dE3T9Nd fs+VN/YapCISLC+inv3kRrFdU/emCg+GVRN4BwivcRYtwVjwbskhle9xshwCc4gFG/0t4 joEFKv27eoXdSRbItfTirq2nv0oLRYkKLCej/nzHK3LcnX6LlWY5zr9luepFXFIRpBepg zPpYIAePhD4DPA9A9geCDMvemWlfU3pOD15GIpvBAwtyFQfEf4a+470lfipWK/oXKVA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796210642; h=DMARC-Filter:DKIM-Signature:Received:Received:Message-ID:Date: User-Agent:Subject:To:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=V8raMYIbt/9x8Zvavdh02vHs5YMFyAXlac9gQZZZ9pk=; b=xDFmwBhaN72TVN9LMW7r0Bql2ixztMhLdgt6rwutw/AKBuhpMf94Dddjd+3CnJ5myXZO ZznqUSKXkGZnJdNPmH+0JNrHChn/pYxG4XXtkpDBBJWIjiMPJ29nJ0KI7CAjMSxEkUN98 XAjXlNEgt81QOH7YUGB7yLL9zMJKekEhPdjX8tbfz9FCKSWeCgm2j/tDQfIRK5zbbKjEK NDkUWMT+HTH+fEfJoruDdecv5lxItS0AZ/nQMvWq7kG/v4HAc4rPUgPRz+dAY4/4OEuO8 sNs2KQCokYluTh2PDOyWwj5+E7loJHr4dWJ+rPGJgDjYYQhwFvHE3SsvCjfNRtwv7Ng== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=RL1oOLuN; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.46.50 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11010050.outbound.protection.outlook.com [52.101.46.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88BDC606A322; Wed, 2 Dec 2026 11:24:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 88BDC606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=RL1oOLuN ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MxVwe0/kuCAzrxSM9vTDGGygM9LAEDeqXh0EGpEYK/HQm9DHc6SkuFAK4qQ4frCgRJLH1/3qS7zh6KfPyY4y51seZNtVcWqQ0LjLL/BIfxbC4VLeZ3j902rTG3xGkY1fg5MAOZoGKBu0lJUiHL/TfUHqqMLIlWtcZBw38Bpi0H4WsPfE39d2VVFsTyoIyPG+yL0h0vwIeB30ESEOeB64dsDdY684n6qRMLzLevGnlolXi8Q9fcs+9P5ImS1bupspQFHEei6NQB4q+Xd9Ct43IHyOyTo6+PIXihpLesxN8mPkvMDy3bpKxSg6qJyRx1dWYD8gGzoKZyl4keV/YzZw1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=V8raMYIbt/9x8Zvavdh02vHs5YMFyAXlac9gQZZZ9pk=; b=mAfNp5y4O9TReZ6Ow6q80sohwUc2rC9rHbfkcH7tmQiz+A9X3vAaDgx49bLnEmdjkXb16FIvfoDvFTokTwBkGKTTvtKRIo0dfrLMNEQG7cgoqPwzIS2gsVMyIQEeUKWnzx8Wpt/RZyTQkdoP/5RSto3m8ih5EbddCJdnxYTPn2liCZceEkH95vCRkdvU9NG2+/Q8V69Nx31ZfbQIe0RtJx1v+5v8kkUd/7CLAgHo61q1x3VwoZdLSUCn45IXRR7ad0QgCUoFFZpiGx9ZasqwLkESI6QdhsKRHgCE2SPp23rge0ZnDVE/YvllKXjXGv/qHkECjWwDzaURGYoIaxUOwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V8raMYIbt/9x8Zvavdh02vHs5YMFyAXlac9gQZZZ9pk=; b=RL1oOLuN+mS3APKhmU2PnbTms76kqtd1d+WN1EKJJrcd9CB7qYW1IeOMvSyCxZkEW7/t9vp+450Xf2Uqv4on2IeFPs+7SV8tdHZAbqKk6Wt7hxZd/Jmx/Qlq+Catan9Y9PAx1bf4DJbmve5a8WkK8IiKgVbfqoC8lNOP5NIZxE8= Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from IA1PR12MB292992.namprd12.prod.outlook.com (2603:10b6:208:5a1::21) by SN7PR12MB7323.namprd12.prod.outlook.com (2603:10b6:806:29a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 11:23:58 +0000 Received: from IA1PR12MB292992.namprd12.prod.outlook.com ([fe80::4b88:460d:65c0:def1]) by IA1PR12MB292992.namprd12.prod.outlook.com ([fe80::4b88:460d:65c0:def1%6]) with mapi id 15.21.0688.010; Wed, 2 Dec 2026 11:23:58 +0000 Message-ID: Date: Wed, 2 Dec 2026 16:53:51 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] cpufreq: amd-pstate: Set asymmetric CPU capacity on hybrid platforms To: K Prateek Nayak , ray.huang@amd.com, mario.limonciello@amd.com, rafael@kernel.org, viresh.kumar@linaro.org, perry.yuan@amd.com, hansg@kernel.org, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261125172031.741740-1-Vishal.Badole@amd.com> <20261125172031.741740-3-Vishal.Badole@amd.com> <7fb17998-e523-4264-91af-0af3c25b0143@amd.com> <955f1ea8-65da-4100-93dd-11bfebc4954c@amd.com> <3aea8e22-6721-4dfe-8429-a22d59085fed@amd.com> Content-Language: en-US From: "Badole, Vishal" In-Reply-To: <3aea8e22-6721-4dfe-8429-a22d59085fed@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MA5P287CA0069.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:1b3::17) To IA1PR12MB292992.namprd12.prod.outlook.com (2603:10b6:208:5a1::21) X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB292992:EE_|SN7PR12MB7323:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a1af59d-63b0-4a22-8015-08df5066c1fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|1800799024|376014|366016|22082099003|18002099003|921020|10067099003|56012099006|261026140227099003|261026121527099003|261102123227099003|261021121427099003|261028144727099003|261022075727099003|261022105027099003|261009223027099003|4143699003|11063799006|6133799003; X-Microsoft-Antispam-Message-Info: 4OPqy8Mx8WAi/P3wV3ZUiKqoDELT+xeDJnDtrII5U6O7RFPXlqKh5B8ZItwBCqOLuU/vnjvJ3YJhifRg06RLSDTrkskaOqXWE/g+s4IjQg6Z//GBNVXtvHLRAx3deMqWD/eoWm/qK1P5CubSgNiGdyTaPoRYrmPvnOwsUVASlntcf2+SnWYGye4k9QPMYiwO0BKlpbhz1dnrRljYejurWv69R74nT8BIjjnv1yOvE2Y3RpfAwtLgdsnDq0RYE4vC8tFZESYD8iUfNw+6NYS5reUKVi9Q6RMOwDNAn6w60VfUI2FUbFpOTIDf5fuI1mmrRupqHYDGVU7UnJ7vG1H9+yLaGWN7qKEX2ECV9tedR3CrM2c9A0jIoYIwdGh9mIQW3k4M07dK4NJWh6U8bI235jDZBe2TTYkuRPZM4i7zgo7lMLg+AAqBTk5PkKS5arYTWduLjuXGuZsAHSiBnJ8DAL084rCv43i+ydiOG6It4UhKtHIbMqgKaY521cGr+MUSv5mWxVwybwCvkUt43XcSt+TA1JN2EaXmqhsv4y0Xa88CzmKrWoDGzhTvO3CaUPlDcGhcuIBVpMQRsc0452oC7KwyW0oI+EGbBmlY1bI3mWDydZ5OYZz71YYw9L1McuO0ybRCsPLbyG3kgYmT+IYfrIkfsqZgHnF+XpCJPBZoEGHzWjWTwU8xL1QrweVuc5Rn5bOc27bmttLEG608DFO98g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR12MB292992.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(376014)(366016)(22082099003)(18002099003)(921020)(10067099003)(56012099006)(261026140227099003)(261026121527099003)(261102123227099003)(261021121427099003)(261028144727099003)(261022075727099003)(261022105027099003)(261009223027099003)(4143699003)(11063799006)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c01sVk1zTXA1UjlrQmRMNXJnbDgwblZJcW8ySkcrc2RIZDh6Um9XSFJYZ1R5?= =?utf-8?B?ZDBLa09sdnpIRUE0R2t2RnQ5RDJ1Q0c4WkZkb1NvbUFJTVY5R3Q3bXgxNklK?= =?utf-8?B?RzFXdHRNVG1SYTlLTGJkYW1vVHcyQUNNTUMzREZzRVhGNzV1WUczZDB3eFcw?= =?utf-8?B?YTVaZ1FHT0xlV0prOEI3N0wrVjh4RmtJaTMrRGI4T0UwQ1E1aXQwTE1qeGNx?= =?utf-8?B?bHZEQmhqZGQ0eGRKdjljREdzRU5HR1BaSWEyTGZTVnNsb3JkTnl5bEMvNXh6?= =?utf-8?B?cytMdFcyQXlFQXhBeStnR0pXVWZLSmZybTRYMzdLbGtzaEM5Wi9HdHNlaWxC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bHFlWjBkL3BPbDluLzBSR0VVTktCQ0Ir?= =?utf-8?B?NmdQYTlLSXJHMUtFWXRqUUl1MXZVVEFiSWQ1WmFwRUNvOFZtYlJEVlBQemdz?= =?utf-8?B?TDNKOFRNbFhlYjJVOUpabGdwVjZrNkVsVkRQNUk4VHhtK0t5Zm5LOWFrQ1VF?= =?utf-8?B?R01qcVVYL0ZZa1JLWFF2QUVNZlRLeStHY1UwLzFYVlRLaWhpakpDQT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a1af59d-63b0-4a22-8015-08df5066c1fd X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB292992.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 11:23:58.4584 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pF/QI7vx966FzrvbNrZCSW0Rsp+WVHce9vFi+NDSRdtUqRuA1libzj7MpQJ/5T4mbLEV/HbR//7bKLZyXoeOPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7323 On 12/1/2026 3:10 PM, K Prateek Nayak wrote: > Hello Vishal, > > On 12/1/2026 2:48 PM, Badole, Vishal wrote: >>>> +static void amd_pstate_update_cpu_capacity(struct amd_cpudata *data, >>>> +                       bool highest_freq_available) >>>> +{ >>>> +    unsigned long capacity, max_capacity, capacity_freq, base_freq; >>>> +    int cpu = data->cpu; >>>> + >>>> +    lockdep_assert_held(&sched_domains_mutex); >>>> + >>>> +    if (highest_freq_available && amd_pstate_ref_freq_khz) { >>>> +        capacity = data->max_freq; >>>> +        max_capacity = amd_pstate_ref_freq_khz; >>>> +        capacity_freq = capacity; >>>> +        base_freq = max_capacity; >>>> +    } else { >>>> +        union perf_cached perf = READ_ONCE(data->perf); >>>> + >>>> +        capacity = perf.highest_perf; >>>> +        max_capacity = amd_pstate_ref_highest_perf; >>>> +        capacity_freq = perf_to_freq(perf, data->nominal_freq, perf.highest_perf); >>> >>>                  So this is literally "data->max_freq" >>> >>>> +        base_freq = perf_to_freq(perf, data->nominal_freq, max_capacity); >>> >>>                  And this would likely be equal to "amd_pstate_ref_freq_khz" >>> >>>> +    } >>> >>>          Making both those branch pretty much the same. Why isn't just the >>>          frequency reference enough? >>> >> Yes, when maximum-frequency data is unavailable for this CPU, this expression is equivalent to data->max_freq, which was calculated using perf_to_freq(). >> >> However, that is a frequency estimate derived from CPPC performance values, not necessarily the CPU’s actual maximum attainable frequency. In the frequency-based branch, data->max_freq comes from amd_get_max_frequency() and represents the maximum attainable frequency independently of those performance values. >> >> On older hardware, the highest-performance values of 196 for performance cores and 130 for efficiency cores aligned reasonably with their relative maximum frequencies. On newer hardware, these values are 255 and 252, which no longer reflect the Fmax difference between the core types. Performance-based scaling therefore gives almost equal capacities, whereas using the maximum attainable frequencies gives capacities of 1024 and 718. > > So in amd_pstate_init_freq() we have: > > max_freq = amd_get_max_frequency(cpudata->cpu) * 1000; > if (!max_freq) > max_freq = perf_to_freq(perf, nominal_freq, perf.highest_perf); > WRITE_ONCE(cpudata->max_freq, max_freq); > > > "cpudata->max_freq" calculation already accounts for this branching and > looking at the max_freq across all CPU is enough to capture the new and > old systems right? > > New systems will have "max_freq" set based on amd_get_max_frequency(). > Ols systems will use the difference in "perf.highest_perf" to calculate > it differently between performance and efficiency cores. > > What am I missing? > On older systems, frequency is calculated from the CPU performance values, which remain unchanged. On newer systems, these values have changed across CPU types, so the maximum frequency is obtained using amd_get_max_frequency(). >> >> Also, the fallback branch can be entered when only the reference CPU lacks frequency data. In that case, the current CPU’s data->max_freq may contain an actual Fmax, so it is not always interchangeable with this perf_to_freq() calculation. >> >>>> + >>>> +    arch_set_cpu_capacity(cpu, capacity, max_capacity, capacity_freq, base_freq); >>> >>> ... >>> >>> And that means they'll have same capacity, but different frequency scale. >>> That reads a bit wrong to me. Different frequency scale will help cap the >>> PELT tracking but the CPUs themself will appear as same capacity which >>> would do the wrong thing. >>> >>> What do these highest_perf numbers look like on real hardware btw? >>> >> 255/254 for performance core and 252 efficiency core. >> >>>> +    topology_set_cpu_scale(cpu, arch_scale_cpu_capacity(cpu)); >>>> +} >>>> + >>>> +static void amd_pstate_set_cpu_capacity(struct amd_cpudata *cpudata, >>>> +                    bool highest_freq_available) >>>> +{ >>>> +    union perf_cached perf = READ_ONCE(cpudata->perf); >>>> +    int cpu; >>>> + >>>> +    lockdep_assert_cpus_held(); >>>> + >>>> +    guard(mutex)(&sched_domains_mutex); >>>> + >>>> +    if (perf.highest_perf > amd_pstate_ref_highest_perf) { >>> >>> Btw there is other side to this where all CPUs of the highest >>> capacity are offlined and you'll need to recaliberate the >>> reference again if you have efficiency and low-power cores. >>> >> If performance cores are kept offline at boot using maxcpus=, the current logic already handles this by selecting the highest-performance online CPU as the reference. >> >> For runtime offlining, I don't think recalibration is necessary. Offlining performance cores does not change the maximum capabilities of the remaining efficiency and low-power cores. Keeping the existing reference preserves their relative capacities, even if no online CPU then has a capacity of 1024. >> >> Is there a scheduler requirement that the highest-capacity online CPU must always be normalized to 1024? > > I think so: task_util() can reach 1024 as its maximum independent of > CPU capacity and the misfit check does: > > fits = fits_capacity(util, capacity); > ^ ^ > Task util CPU capacity > > CPU capacity is derived from arch_scale_cpu_capacity(). You'll always > trigger a misfit but won't find any better CPU to migrate to if all > your reference cores are offline and you've not updated your > efficiency cores to 1024 capacity. > Thanks for sharing this information. On the AMD platforms CPU0 is a performance core and is expected to remain online during normal operation, so the case where all performance cores are offline is not expected. However, I will address the runtime case where performance cores are taken offline while all efficiency cores remain online. I will include the necessary changes in the next patch revision.