Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp859187rwb; Tue, 27 Sep 2022 05:41:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM65wY7LXSwdfZsi/FYaZNRNFAkLopvgVgC9J1iRBU3FsKCSwJOhtyhaH/tyhRv1XJE1gWhP X-Received: by 2002:a05:6402:5489:b0:43b:b935:db37 with SMTP id fg9-20020a056402548900b0043bb935db37mr28128396edb.347.1664282512471; Tue, 27 Sep 2022 05:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664282512; cv=none; d=google.com; s=arc-20160816; b=pqOvp08Xjxi9sx5hEocJBeriuLKAJmxzB5bs4uBjo9lA9d+xp5biaopfGIw3CisTJy QkdtIQVRpiKT9yXnP7dBqAgGDGOQDY3o6A2dlEt6uayJle2a+E45jvLDn07+0i0Vyk0c z0RRcUhQCGWKasaEqZjPamp+78712tzGMTUdGZnkZ7wb+t7L11x9Ugc+xWFw1DMIDKlf Kh5dlHSl7nK2vzpJycpO6L5M2tklueGamXw9iQx4zFkFYdCgnll5ANQ8//0SM+YyUC0l rbE5Kotm+uGxdvOzxOc6GMBKnnDed/qJjrQESU8Ochh+rFx3aIJvqfh+tPairJN6G9Wr Hprg== 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=zW6i4/KDt/L5ZSg8SCVrQyvw0UbCm3JHb9boUSO439E=; b=uhtpFVPl3YNEBIniAuens1uukNSKnu36su+bLmeq7ekFoXAo+V/Am0u92gSTgX1h0F DW3ozwA3/Ie2ZiST2hqdLiuMmQv8Hyv6ql9O6bjr2dXrpzmmxh1BtxgVq6xZ1kEdrp3C yBC0H1rvgI4cOt1+dFzrVr2JFj2KvmU1Gc4wtR5S3+w6+1t66UiIkb6bUQMIH055qV5K lSO1/pMmbI5W7J3n+64vt6WN0qa/2a9CVPmLHTYdmI5gHo23Wdc0ce6RP5oN6NNIKH0Z Fgvixicj6/rB9XQfAdmp69rVyQCaTHmXO/RCka/Lu8x6M+67AeLc0HicE3rylrx0Aqes ztMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PYzMO0cl; 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 sd21-20020a1709076e1500b0078164647095si808153ejc.68.2022.09.27.05.41.25; Tue, 27 Sep 2022 05:41:52 -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=casper.20170209 header.b=PYzMO0cl; 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 S231789AbiI0Ley (ORCPT + 99 others); Tue, 27 Sep 2022 07:34:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231269AbiI0Ler (ORCPT ); Tue, 27 Sep 2022 07:34:47 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 934F74BD24 for ; Tue, 27 Sep 2022 04:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=zW6i4/KDt/L5ZSg8SCVrQyvw0UbCm3JHb9boUSO439E=; b=PYzMO0clRYHSdrkM1Ta1v9oSzb fjyj4vDguDz5rGfbxg/G5G3aLHHJs2wJg4Hc6RAvg9YHdcDxOMmFEjGnavk1Q7Vx7g958bghCXlwg ni4N0zhmxN4klyxaYjlV/pWFjqcUSD/1Lk2NOp7wra6YViNg18YDu0OJtAbiha7s29XANtewn28AC 9VWpTwKociCBodlBUtAoOhp1BFAi528YTLSVgT4XbXVjhOLq2bHM18h4nLpuQC56GRSN1ku0dbymR EtV57YuiRyUrCBbIh5UXGuhPRtzc4OPGcpGmNolvVGp2Hru3YS9AWy6cFKgPMOjQIKbFtwjZG8Q1A ps+OYf8g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1od8qp-00BNqK-Ue; Tue, 27 Sep 2022 11:34:12 +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 2AC54300205; Tue, 27 Sep 2022 13:34:08 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DE0292BDDB52B; Tue, 27 Sep 2022 13:34:07 +0200 (CEST) Date: Tue, 27 Sep 2022 13:34:07 +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 12/23] thermal: intel: hfi: Convert table_lock to use flags-handling variants Message-ID: References: <20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com> <20220909231205.14009-13-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-13-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:54PM -0700, Ricardo Neri wrote: > --- a/drivers/thermal/intel/intel_hfi.c > +++ b/drivers/thermal/intel/intel_hfi.c > @@ -175,9 +175,10 @@ static struct workqueue_struct *hfi_updates_wq; > static void get_hfi_caps(struct hfi_instance *hfi_instance, > struct thermal_genl_cpu_caps *cpu_caps) > { > + unsigned long flags; > int cpu, i = 0; > > - raw_spin_lock_irq(&hfi_instance->table_lock); > + raw_spin_lock_irqsave(&hfi_instance->table_lock, flags); > for_each_cpu(cpu, hfi_instance->cpus) { > struct hfi_cpu_data *caps; > s16 index; ^^^^ Anti-pattern alert! Now your IRQ latency depends on nr_cpus -- which is a fair fail. The existing code is already pretty crap in that it has the preemption latency depend on nr_cpus. While I'm here looking at the HFI stuff, did they fix that HFI interrupt broadcast mess already? Sending an interrupt to *all* CPUs is quite insane.