Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp592798pxh; Tue, 9 Nov 2021 15:50:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzE+rOIEm/qXJYeMEFkeSehczlnO647gJvBDsDtFQv9m9kwJBbuaDuZ/naFi2Hy5vxiRc6d X-Received: by 2002:a92:d48f:: with SMTP id p15mr7931031ilg.236.1636501847930; Tue, 09 Nov 2021 15:50:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636501847; cv=none; d=google.com; s=arc-20160816; b=louPvma8QP2CXwnHwp8Cxm4Hi80H0gdWu0wnAtVadI+80fgQPx5yx1Zk3gMzGEsxjb YzjLjLwX9v8Y1sMdHpEx6F/nnO0K6RpgmBlekZx8HgLx+gUKhkpV7AKpHsSGlXEJFUs5 YY3hEcqlyHL7ROeJYvWHLeF0PAWdE3YMVxR8ruAJ00BcwVDwa6jRG/RaigmNogjy1FXv ZexLEVjjSwPrZIdJ62GFqZTAT4W4BvTNK3dkpflZf3SMjrWEkpkhVYtNzVAZMgzkDaAD 3Lv9tYlOmSbgQNbpQTB6HdztKpa26rGrgXkQj7mJNbnK4Z6iNWPfukxcdZExWmYn6V0X 5OGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=ZSh6GxIQNvrJzY0nB6V9XQ0omNM+B98sr1gOovgb4+M=; b=zuTJyKLLwH9bdhszjhe9k2QPbvGCsfHQItbR5cgJ2lerbO1wmEHTy+3y4bg95JFFRt yNIJyRRACrzT4N08kcBYZUOSrZhqZ8IKB112HHmJczf8m9OMzz0iJ/rH8pt+rrquBdw3 rRImVbdm84kUIaYYJBe+6WH8rhBqrNi0CCFljXwO72EVXScaCP94L1Sb2ylw2Oo34jBw oMWcgJEK3saoKrrnoFKU0DGuQJ+o9kiZvdlFYSC5+Vbd8Ds/7tpG/Np/rwKhQTdJvXpR GRnTVdY9J14QAG4jK/DCbTA8FRe8Z605TMsORrtm17zhCAVR8ymv6xSwIqRX6epQOycH Qp8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si30492710iln.165.2021.11.09.15.50.35; Tue, 09 Nov 2021 15:50:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233824AbhKIN03 (ORCPT + 97 others); Tue, 9 Nov 2021 08:26:29 -0500 Received: from mga17.intel.com ([192.55.52.151]:54047 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbhKIN02 (ORCPT ); Tue, 9 Nov 2021 08:26:28 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10162"; a="213171935" X-IronPort-AV: E=Sophos;i="5.87,220,1631602800"; d="scan'208";a="213171935" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2021 05:23:42 -0800 X-IronPort-AV: E=Sophos;i="5.87,220,1631602800"; d="scan'208";a="451912478" Received: from na1-mobl.gar.corp.intel.com ([10.213.108.242]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2021 05:23:35 -0800 Message-ID: Subject: Re: [PATCH 6/7] thermal: netlink: Add a new event to notify CPU capabilities change From: Srinivas Pandruvada To: Lukasz Luba , Ricardo Neri Cc: "Rafael J. Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org, x86@kernel.org, linux-doc@vger.kernel.org, Len Brown , Aubrey Li , Amit Kucheria , Andi Kleen , Tim Chen , "Ravi V. Shankar" , Ricardo Neri , linux-kernel@vger.kernel.org Date: Tue, 09 Nov 2021 05:23:31 -0800 In-Reply-To: <2160a0b8-59ec-03a1-1fd5-a3f98085be07@arm.com> References: <20211106013312.26698-1-ricardo.neri-calderon@linux.intel.com> <20211106013312.26698-7-ricardo.neri-calderon@linux.intel.com> <2160a0b8-59ec-03a1-1fd5-a3f98085be07@arm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lukasz, On Tue, 2021-11-09 at 12:39 +0000, Lukasz Luba wrote: > 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? > That would have been very useful. The problem is that we may not know the maximum performance as system may be booting with few CPUs (using maxcpus kernel command line) and then user hot adding them. So we may need to rescale when we get a new maximum performance CPU and send to user space. We can't just use max from HFI table at in instance as it is not necessary that HFI table contains data for all CPUs. If HFI max performance value of 255 is a scaled value to max performance CPU value in the system, then this conversion would have been easy. But that is not. > > > > 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 < > > srinivas.pandruvada@linux.intel.com> > > --- > >   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; Good idea. Thanks, Srinivas > > 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