From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B842C433EF for ; Tue, 9 Nov 2021 12:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7C6361130 for ; Tue, 9 Nov 2021 12:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235446AbhKIMmc (ORCPT ); Tue, 9 Nov 2021 07:42:32 -0500 Received: from foss.arm.com ([217.140.110.172]:33256 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243023AbhKIMmc (ORCPT ); Tue, 9 Nov 2021 07:42:32 -0500 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 048BAED1; Tue, 9 Nov 2021 04:39:46 -0800 (PST) Received: from [10.57.26.224] (unknown [10.57.26.224]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A95CE3F7F5; Tue, 9 Nov 2021 04:39:42 -0800 (PST) Subject: Re: [PATCH 6/7] thermal: netlink: Add a new event to notify CPU capabilities change To: Ricardo Neri Cc: "Rafael J. Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org, x86@kernel.org, linux-doc@vger.kernel.org, Len Brown , Srinivas Pandruvada , Aubrey Li , Amit Kucheria , Andi Kleen , Tim Chen , "Ravi V. Shankar" , Ricardo Neri , linux-kernel@vger.kernel.org References: <20211106013312.26698-1-ricardo.neri-calderon@linux.intel.com> <20211106013312.26698-7-ricardo.neri-calderon@linux.intel.com> From: Lukasz Luba Message-ID: <2160a0b8-59ec-03a1-1fd5-a3f98085be07@arm.com> Date: Tue, 9 Nov 2021 12:39:40 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20211106013312.26698-7-ricardo.neri-calderon@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org Hi Ricardo, On 11/6/21 1:33 AM, Ricardo Neri wrote: > From: Srinivas Pandruvada > > Add a new netlink event to notify change in CPU capabilities in terms of > performance and efficiency. Is this going to be handled by some 'generic' tools? If yes, maybe the values for 'performance' might be aligned with capacity [0,1024] ? Or are they completely not related so the mapping is simply impossible? > > Firmware may change CPU capabilities as a result of thermal events in the > system or to account for changes in the TDP (thermal design power) level. > > This notification type will allow user space to avoid running workloads > on certain CPUs or proactively adjust power limits to avoid future events. > > Cc: Andi Kleen > Cc: Aubrey Li > Cc: Tim Chen > Cc: "Ravi V. Shankar" > Reviewed-by: Len Brown > Signed-off-by: Srinivas Pandruvada > --- > drivers/thermal/thermal_netlink.c | 52 +++++++++++++++++++++++++++++++ > drivers/thermal/thermal_netlink.h | 13 ++++++++ > include/uapi/linux/thermal.h | 6 +++- > 3 files changed, 70 insertions(+), 1 deletion(-) [snip] > > +struct cpu_capability { > + int cpu; > + int perf; > + int eff; Why not use the full names, instead of thse shortcuts? We use full naming e.g. in cpufreq framework such as 'frequency' not 'freq'. The 'eff' is really not meaningful ('perf' a bit less but it has to meanings in kernel). Regards, Lukasz