Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp644845rwb; Thu, 6 Oct 2022 02:27:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BzAyLNL77SHsEKs+hXe/SWtfiORTVZfbyIGfK2OWcQJd5EeAU/kLfSjJzpFWWOO5akvcD X-Received: by 2002:a05:6402:249f:b0:453:eb1b:1f8b with SMTP id q31-20020a056402249f00b00453eb1b1f8bmr3654550eda.235.1665048421637; Thu, 06 Oct 2022 02:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665048421; cv=none; d=google.com; s=arc-20160816; b=IIGVY2cN7N5MPckwpaRsL/zZUfGTn4QfdZDscx/I7MfN+PjcwvmiaxjO9kyXUdZ2zU OpjpOVY5Yk6xOaJ7NgBS3AW3beuIzQBSQ+gq28JAQ5ATVQl4p8W+ex0hyTNf8CDwo/4O 2z0lG9UsugHqZ/XFAuTQN3PWf99UT20htt+Ur7aitrHjXKyFKNXa2rW5n9rq/mw73sOc JDkJdH/VwtN6ZrjX6d3E5z+TJE6pm3b2Svy7IxTKGMTUuZ+jnZGWKg+/Gk8P0Ldy+4EH +hk4XZ3dyuwAt+yO2H9maMjGy2AzkY/fs6Wkf7RKY+EGFuKZvIV9lslBzI0Py0/7feFu cItg== 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=ot4ktfeknrez+0rFTxYXifglqcTo/ZnYJl8BenTVKT8=; b=OtyrIIqGE04PkfAJLD/IMIXm0NmVO+xBtJmajRawSIO0fEaH8+iHJjNsTAlWpsNnc5 aNzyYXeGAAxcEQ2jBN/tRrPsQ2e0CWRfHJDLPzTouerDb2nbc4yBtuLJNpFBQH28dWXx snNoFkdqw+CD9sIgtSRb/mUJEXXQtlGntlH83JKQ6tLYRC+fIy+Qj3cmJTbJ0ERKqy/2 S+N2/90byH8sK2MwP0X9G8knmThu38EwN8SM0Qr0Ye7aoKcQ+ct/ZUtQqfBjPEUQgEvv nXGnYvPh2PHq+Ad8qYwR4fkyzMmV3/Eq+dDyByS3BR7iAb8GvJPmqwcr6gpiHTdndlv6 /c9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=OYP1NBP+; 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 k16-20020a05640212d000b00457f31c1a10si15028741edx.584.2022.10.06.02.26.36; Thu, 06 Oct 2022 02:27:01 -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=OYP1NBP+; 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 S231356AbiJFJPZ (ORCPT + 99 others); Thu, 6 Oct 2022 05:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231325AbiJFJPV (ORCPT ); Thu, 6 Oct 2022 05:15:21 -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 E65442E9E1 for ; Thu, 6 Oct 2022 02:15:19 -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=ot4ktfeknrez+0rFTxYXifglqcTo/ZnYJl8BenTVKT8=; b=OYP1NBP+/E3tDZzycmcMtHbf8Y pdT7bOvfRha18Og/QcPUP1Mf/P2LothmUh1QIQ4bFBqvJrmXNsRU/Oy9C06ZIH2W+P/09DeMuW1an Wdsubt7zO0QTESdw7BRjirsVw4f0xo+jk/g/apg0kIDp190KQaIAj8kSQ+bxQk383Vj6zPkSjsTLT 5aoeIGDAH/IAHX32IapsNkoSwMemIETcqc0MQyAhaQ4/nCRh0VLKxXAezAr0GP8kp3R5kD5pFOFjc l45cv6E3rl9nj/10JHtr/IZbJtclzeCpMS5qUQAWWkbBjzfqwzyt7CQxNumQ+ihre3xs7HIww48gR 4CvtKaUw==; 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 1ogMy0-001Cea-Ph; Thu, 06 Oct 2022 09:14:57 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id AFA0F30017D; Thu, 6 Oct 2022 11:14:55 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8287E209D9D88; Thu, 6 Oct 2022 11:14:55 +0200 (CEST) Date: Thu, 6 Oct 2022 11:14:55 +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: 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 Thu, Oct 06, 2022 at 10:52:16AM +0200, Peter Zijlstra wrote: > 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? I enabled this HFI crud on my ADL (INTEL_HFI_THERMAL -- because apparently Debian doesn't default enable this) and now I get all of _1_ interrupt during boot. Building a kernel on that machine doesn't manage to trip another one. TRM: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Thermal event interrupts So yeah.. *can* change, but doesn't.