Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp623272pxh; Tue, 9 Nov 2021 16:21:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd/IxYagFxVKai+B7gi6YQr8Pldwu3+g2ZJYYyJJ9aQHKRc836+wdgzV2oMcFj1h3EvZ4/ X-Received: by 2002:a05:6e02:ea9:: with SMTP id u9mr8309269ilj.1.1636503680722; Tue, 09 Nov 2021 16:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636503680; cv=none; d=google.com; s=arc-20160816; b=Z4VouTTZa+8wLia2GsN+4mwqTa3h3VaTjUajuWQWjDRy4EZFDNN7Wq/toN3XfYwLR4 hq9uR0GcYUTpRP1OtEzdnbJ4wQQgHObfO0QoU9qHxT+v7BGChKPhhbhuUmXpO/OaEZrt VLF2nCcDhodQwkE4UqSphWpt1rL5eGZ++qt/3gy5kdJiiOZzjqoYr4oIXiv6g9JwLOJA c9jmm3juDDGZkYk/paDaqY8coe1JRXe5EPiwZ/0uxi9lDei5kI8zg2oD7tUVvgnuTyrO plI4UGTrqrqwv9rdZHi/STqL3cv4X+K3xxh8EeVMxDjjsl9VhRP4CeZdBNp2xHlrDV9i 8/sw== 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=iMLDKNSrowEWTXjde8QBTyoxGNtG8KYjejKUtWdKH9c=; b=C3ayUxSc/1WeQa3NZcL0fLD1YW+g8mlblQgtCRjTFPzodjKHJ+FpPr9XrJv/8qjpDN 02iiMUJGiJEOONm4NAJodwJJLNoyYtbmYeE72eyeNHb+MFKmwxT4n5//xI6eBOmnnq/T aLHczM7GyEgt9rxu80DTh6xYZI2TaggPFGfvQM/IVd5Ch7AOs9glGxFZR9k8Ve5FCHbJ mr7eAxdpsVYwG5m3MWOrkwyOjx1Lv3M7lMz8dxnjtJ0s0gR2nuk8NCXymo7R4Pf1E8cu pdO3tsYoEJDAC9A2fgFfH+3DgIc3zjZcffhSL5697zgPKFWRf8Nb0eH8YoSih4MIi7z1 vAXQ== 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 x12si41582413ill.167.2021.11.09.16.21.08; Tue, 09 Nov 2021 16:21:20 -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 S240176AbhKIV2t (ORCPT + 97 others); Tue, 9 Nov 2021 16:28:49 -0500 Received: from mga12.intel.com ([192.55.52.136]:52883 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236380AbhKIV2s (ORCPT ); Tue, 9 Nov 2021 16:28:48 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10163"; a="212575271" X-IronPort-AV: E=Sophos;i="5.87,221,1631602800"; d="scan'208";a="212575271" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2021 13:25:52 -0800 X-IronPort-AV: E=Sophos;i="5.87,221,1631602800"; d="scan'208";a="503677118" Received: from siddaraj-mobl1.gar.corp.intel.com ([10.213.89.120]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2021 13:25:46 -0800 Message-ID: <9213e3f8fbe53329aacff1152ca3e20b6cffbbdb.camel@linux.intel.com> Subject: Re: [PATCH 6/7] thermal: netlink: Add a new event to notify CPU capabilities change From: Srinivas Pandruvada To: Lukasz Luba Cc: Ricardo Neri , "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 13:25:42 -0800 In-Reply-To: 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> <5e4d7661-1e91-0c72-ae02-b2c60c2ad95e@arm.com> <94ddfd1177c3f119de2794d9fb659a6578f560c6.camel@linux.intel.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 On Tue, 2021-11-09 at 17:51 +0000, Lukasz Luba wrote: > > > On 11/9/21 2:15 PM, Srinivas Pandruvada wrote: > > On Tue, 2021-11-09 at 13:53 +0000, Lukasz Luba wrote: > > > Hi Srinivas, > > > > > > On 11/9/21 1:23 PM, Srinivas Pandruvada wrote: > > > > 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 < > > > > > > srinivas.pandruvada@linux.intel.com> > > > > > > > > > > > > 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. > > > > > > I see. I was asking because I'm working on similar interface and > > > just wanted to understand your approach better. In my case we > > > would probably simply use 'capacity' scale, or more > > > precisely available capacity after subtracting 'thermal pressure' > > > value. > > > That might confuse a generic tool which listens to these socket > > > messages, though. So probably I would have to add a new > > > THERMAL_GENL_ATTR_CPU_CAPABILITY_* id > > > to handle this different normalized across CPUs scale. > > I can add a field capacity_scale. In HFI case it will always be 255. > > In > > your cases it will 1024. > > > > > > Sounds good, with that upper limit those tools would not build > up assumptions (they would have to parse that scale value). > Although, I would prefer to call it 'performance_scale' if you don't > mind. Sure. Thanks, Srinivas > I've done similar renaming  s/capacity/performance/ in the Energy Model > (EM) some time ago [1]. Some reasons: > - in the scheduler we have 'Performance Domains (PDs)' > - for GPUs we talk about 'performance', because 'capacity' sounds odd >    in that case > > [1] > https://lore.kernel.org/linux-pm/20200527095854.21714-2-lukasz.luba@arm.com/