Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp832153rwb; Tue, 27 Sep 2022 05:22:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5hPiamdJ4zUVnp0XRQNBPv7jEmuelITkJu5cBokwHKqaDM0ZPT7Sja4HDk4wNyAmc5lGGX X-Received: by 2002:a17:906:6a2a:b0:782:356e:4207 with SMTP id qw42-20020a1709066a2a00b00782356e4207mr22728266ejc.167.1664281370547; Tue, 27 Sep 2022 05:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664281370; cv=none; d=google.com; s=arc-20160816; b=KmaOrtV2o5SN1OEwGZw1pJdAIo5Rdl+dTnJjawI4P4H0Tm4b63LoPuopDl8mTwbi2U enZrvH5jlSidwQntsDZ+Fg0sIEnNJjd11Zyk8hCVDWIjQxe6Z+3iyQTrrU8bKS2V64RX KPtG9WcrsRZtMOs8YGB/NXw3FuUimgI/4TurQatN7YQMwKbC72aJaDm8z9ePVPqktR6V wPnmtEeApsPw1M97ddcyGWhhZfChCAU3pNv27aOTrv2/lHglz1Ef/LzQN8UiblVtUrez ua3ao+G8EHdzw8mNlLM4NUxYWZBlNomBcGv/dnW/ZbVUhWeF7jEOKQyHFE77S79ttdAR Un9g== 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=icSRnCoa38KYWodS1KJV18+kpFMUC/PtthRr0+r/Edo=; b=apGIaj5O+YBFgFrEHK+A9pCvQMfCJ0MNrzh1GBrpbSiXTiKTokGkqFwc1JmZ+5firN lTfCl4ITOj8FXncsehByKiEEt11PZG9mcD7VRqQBlo8n4sn9ie+Lzw+gtw7CyvmTcKoL 4se4tvUP9P2V6WkvNfXQSGcOvnYqFR8POglhIHLPyTUP/RHdWDCUqJvqJM2YmmxHz411 FRjLU6u1540dGNF1uStYmEJOytU4PT8hQtvBdxNY92tcqgS6Eb135SkDMUXlE6Zgtn90 U2o85q27O70ig+jCZTxPw2ru6OX9JnNe0fSLUZEMJbZRa2AVSaEYwWZVjaxGG8L3OO2K KxXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Flav9QFb; 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 ht21-20020a170907609500b0074172ed562dsi1084408ejc.813.2022.09.27.05.22.23; Tue, 27 Sep 2022 05:22:50 -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=Flav9QFb; 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 S231305AbiI0L7h (ORCPT + 99 others); Tue, 27 Sep 2022 07:59:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbiI0L7d (ORCPT ); Tue, 27 Sep 2022 07:59:33 -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 9D23774E23 for ; Tue, 27 Sep 2022 04:59:30 -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=icSRnCoa38KYWodS1KJV18+kpFMUC/PtthRr0+r/Edo=; b=Flav9QFbDX3Q8+UYnVPuCpnmsv L8fJeFrb9Kf/5IwesrifQi8Fd2Mvfy6x/t8IuXHSmL9AR8zglzTKBTgTalo/rwYxTI+jbjYgCbuC9 TVUWcON+CBDXYzz+8udZPaDyYoYmTD7N6iKEonOtmlXhWexeARjpAXyA1R8fymi+lIGSNiWWekF6y GOHkylLNKAzgiieVJmkNobPVvJe/rQbCrkXwP0dtduiHhHxKFS3Zz40z3QGO1L2B4Q0ejR768pedK 7avs5oz1cOAWiCjnYkeZww8ReubKIb5YXmzEN3rwZSz547XHM2HN/Bt9nKXGgnCz3ey+cdy6zh5lD x0wQPTaA==; 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 1od9F6-00GHPa-M3; Tue, 27 Sep 2022 11:59:17 +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 12C4C300205; Tue, 27 Sep 2022 13:59:16 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E38A72BDDA85A; Tue, 27 Sep 2022 13:59:15 +0200 (CEST) Date: Tue, 27 Sep 2022 13:59:15 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909231205.14009-16-ricardo.neri-calderon@linux.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 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?