Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp677734rwb; Thu, 6 Oct 2022 03:01:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5y/ZrEKlWxQP1b3nP4mbdCiLSStIPcC+xym1q6TRXYoWEPEkys6gp3yBD80MIwocufgSAJ X-Received: by 2002:a05:6402:1e96:b0:459:68bb:867 with SMTP id f22-20020a0564021e9600b0045968bb0867mr3688330edf.45.1665050481819; Thu, 06 Oct 2022 03:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665050481; cv=none; d=google.com; s=arc-20160816; b=qfsROnMGfHaCd/hHvHJOhP+bhWfeKuYXAbCTJgZ8Knm9Trk/Jn5IDjv1FDu9SVwWAR 0HwYv+fGTtiEr5d4n5n/ny6PCAwrI+E3lKiBCsiRj+oL3Upxl+si0hhc8Rfj53V+zgWs E8Hwsc34JvqwtX001IogxwtUVqlc+ViZgJF61AAHpRgJdwuOm05KSfMFYKTqLEgdaFH0 G95x/g1M7fWiNbEK4Ea5llkmnFssg2rDIRO3Wse35/SzDaysCX29GwPvTuWiNVVQxajZ tyHGhJabQGpXnxkKpmhuSn3f2mUbWn+AWjwsoPB1fxI8HWm53mqqV+/iC0ov4R7f1cNZ mYMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=udkEFmCXVqapQ+97j25lRFC1Dm0RkLMeqKyy1j0mF+U=; b=NP8651M4RKiuaKtfkrHj9z673EFldnC/S952X1x+CF7XWACHV7vKqkvO7lEI3U8shS m5rcva3lNbrrcq5CUucG+vBaAJXu2TEqPrcH6u2WVLG7BXCUieEqaZRCGCT3tt+KEbSq 71vAaGzAt+SRjZvkqgdhjJvdnFpUMUU4Ggmw9xJGPimm85A+S6/Amlhdy+JnGySp4PPk WoF6L+k1BW+rCcHF3KTq1xa8/yC5ll9Ue0ZOYTDQIqPRuhbXP5B3TQ+rTotu2+1O1Yal BI7O5zUcVMUSDK8ncI1LI2b66HlKbl1awFPwJs58qZ++FtKvkOaz/mKtQsIu6GPJ+OXf PwLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=KrvcRa1U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc15-20020a1709078a0f00b0078c0d710c0csi10550722ejc.192.2022.10.06.03.00.54; Thu, 06 Oct 2022 03:01:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=KrvcRa1U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231247AbiJFIwn (ORCPT + 99 others); Thu, 6 Oct 2022 04:52:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230487AbiJFIwl (ORCPT ); Thu, 6 Oct 2022 04:52:41 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DCA06D9CB for ; Thu, 6 Oct 2022 01:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=udkEFmCXVqapQ+97j25lRFC1Dm0RkLMeqKyy1j0mF+U=; b=KrvcRa1UoK/fkRb9mijyQM4ZG7 voy75DPSzDG7BwFP2yVnlenEepuvK8qIBfgVlFEKX2BNZBBYNkFvs+r54G46v7RL3WzNGmMJCzohn M3xz71XhAZX0SEFt8GfdIUaLcnV5f9mpHn03IZk1DhZKPlvevl01Gnwz3MKx1vOVBG79hcG3REd1B 2zzkz+N98VhvGmWL17ATnQ9UMop4ORcLHYIJGMtdoGE8z0cl7SvIpQ6ITLlWm+nU3MqgK8fLpGzgU o1hQkyys6qEmtD0hZCX4rMvmQzODbbr2U5b9tDl9QZYeBkEFu65HVKIHAE/QGMleClA4SX/arwhxn 1gYR9y/w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogMc6-001CPG-Ec; Thu, 06 Oct 2022 08:52:18 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0944E30007E; Thu, 6 Oct 2022 10:52:16 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B84A7201FC2CE; Thu, 6 Oct 2022 10:52:16 +0200 (CEST) Date: Thu, 6 Oct 2022 10:52:16 +0200 From: Peter Zijlstra To: Ricardo Neri Cc: Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org, "Tim C . Chen" Subject: Re: [RFC PATCH 15/23] thermal: intel: hfi: Report per-cpu class-specific performance scores Message-ID: References: <20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com> <20220909231205.14009-16-ricardo.neri-calderon@linux.intel.com> <20221005235959.GB29251@ranerica-svr.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221005235959.GB29251@ranerica-svr.sc.intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 05, 2022 at 04:59:59PM -0700, Ricardo Neri wrote: > On Tue, Sep 27, 2022 at 01:59:15PM +0200, Peter Zijlstra wrote: > > On Fri, Sep 09, 2022 at 04:11:57PM -0700, Ricardo Neri wrote: > > > Support the arch_get_task_class_score() interface of the scheduler. Use the > > > data that Intel Thread Director provides to inform the scheduler the > > > performance of a class of tasks when placed on a given CPU. > > > > > > > > +static void get_one_hfi_cap(struct hfi_instance *hfi_instance, s16 index, > > > + struct hfi_cpu_data *hfi_caps, int class) > > > +{ > > > + struct hfi_cpu_data *caps; > > > + > > > + /* Find the capabilities of @cpu */ > > > + caps = hfi_instance->data + index * hfi_features.cpu_stride + > > > + class * hfi_features.class_stride; > > > + memcpy(hfi_caps, caps, sizeof(*hfi_caps)); > > > +} > > > + > > > +int intel_hfi_get_task_class_score(int class, int cpu) > > > +{ > > > + struct hfi_cpu_info *info = &per_cpu(hfi_cpu_info, cpu); > > > + struct hfi_instance *instance; > > > + struct hfi_cpu_data caps; > > > + unsigned long flags; > > > + int cap; > > > + > > > + if (cpu < 0 || cpu >= nr_cpu_ids) > > > + return -EINVAL; > > > + > > > + if (class == TASK_CLASS_UNCLASSIFIED) > > > + return -EINVAL; > > > + > > > + if (class >= (int)hfi_features.nr_classes) > > > + return -EINVAL; > > > + > > > + instance = info->hfi_instance; > > > + if (!instance) > > > + return -ENOENT; > > > + > > > + raw_spin_lock_irqsave(&instance->table_lock, flags); > > > + get_one_hfi_cap(instance, info->index, &caps, class); > > > + cap = caps.perf_cap; > > > + raw_spin_unlock_irqrestore(&instance->table_lock, flags); > > > + > > > + return cap; > > > +} > > > > Does any of that data actually ever change? Isn't the class score fixed > > per CPU type? > > Yes, data can change. The Intel SDM Vol 3 Section 14.6.7 states that the > table can be updated during runtime. I find the SDM is often unreadable gibberish, this part doesn't dissapoint. There's a ton of might and maybe there; what does it actually do and how often does it do it? Given the thermal interrupt is such a shitshow, we really, as in *REALLY* don't want this to happen at any frequency at all. And if it barely happens, why do we care if it happens at all?