Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1674860rwd; Tue, 13 Jun 2023 12:26:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6M8Yb2sautg8AoMiaLtZ2sALTSKJ9BdT5HBY8l7EH4GhBkRIzV2C2h7hz2q+Z2prWGAwAx X-Received: by 2002:a17:907:986:b0:971:1717:207b with SMTP id bf6-20020a170907098600b009711717207bmr15921698ejc.35.1686684393740; Tue, 13 Jun 2023 12:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686684393; cv=none; d=google.com; s=arc-20160816; b=QT1gwCnIQKzhHcYJEUNc3i+8x/wctInO+C9RJP3Rf6tO1IXdQqF+0bGtka117tTDE4 5y3x6GzmG+vlJwMmGvFr8ITyOHvr/cSCgate5bUiaBkeP/BFXecA3kEbZ18U03FkQ5zf ZatNdc5+kDE62Z3ya0pfG5e8tInfealfyqnv3RyKy2cGGqqYcWOs7utTyJhCetPsEH18 hu2KVqmFDWDepNFDRgzYf2l9/YNLPR/7igU20S4cLB76cO+11j+SW8oV75K0pREZfiQU JOBHCtWsRF9Q2yVM97pQU8zXDYw6jktVxO0sdIEVlKfwezT4c09Q/Zx0blbvVdAJNtWK pxlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=cdtlI8O+BR0qXbj58jg6FvKGaw0Wgflhz7GcVSQmqTs=; b=MJ+twpijRz66YNWv9pTn0ilgSTrDANle5zspROAb/d3WfvltLG8bXfjxhUIDEthpNf CP1+7p3rRvq959JAodOFXH7/WYDM8I1QpxQIWVEIrHg2zkBQY68IZLMtdVds1KAZTJnl Jl6j6LT8CzXrnS2JFhB371qkY4WzT9B0KzraqQcmAupbo1BCGfCve7/1QAt6mAGdoTCP jEP2DVC0xv2NU0E0Wc6uO5lZr+NSNZ1ASJoVGkNDpYkkdo64Vxhv8avYh93RuLmvm/UX Mww7S8fFnBnYJQYLhWoChZe/osJTmbYGoZZdSn4mVQJJiwAAoA2WU+cmndwbAuiByj8T GB7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YozCldYN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=l6BZB5sr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jp9-20020a170906f74900b00969dc13d0b0si7081940ejb.247.2023.06.13.12.26.07; Tue, 13 Jun 2023 12:26:33 -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=@linutronix.de header.s=2020 header.b=YozCldYN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=l6BZB5sr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240031AbjFMSyC (ORCPT + 99 others); Tue, 13 Jun 2023 14:54:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232301AbjFMSyA (ORCPT ); Tue, 13 Jun 2023 14:54:00 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CA0DB5; Tue, 13 Jun 2023 11:53:59 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686682437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cdtlI8O+BR0qXbj58jg6FvKGaw0Wgflhz7GcVSQmqTs=; b=YozCldYNSkvTr+p9N13aPfwrZCetTLmVfUgIMbRgkvTdFFB+KsP7Bc/nFSb3Aypyiv3CtJ HiuQX/BkK7i+txHUJVO80Cn39d+oKpyNlYvhUF6GtTt/iEmIeLnL4hHBqe9qfjvYA8icZW JNHNPfIj64QFoIrIGtcCm13NRVIint6VhQQnicYv56ihWKYgciJBCzhZPAkHZaFFBXXc1A 8607gVBbh+RzZYZJD+9BxOzRVoHJ/rUVtqyFpu3qlIjx34p5HeSyUYw2Z62Fs7yM4TdSfE uLF4gJ6HFLP7AbKgTVN3BrFWVDHbfFUnF1+bUBT4A5G674zBIhW963/HDlYDgA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686682437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cdtlI8O+BR0qXbj58jg6FvKGaw0Wgflhz7GcVSQmqTs=; b=l6BZB5sr7NAcDi+r4y/BXgbOdgHhlHQ9Vb1NshrItcfbmq+cZw4PchfvnAucey7KgaZUrI PGUXnPawzxE9tdAg== To: Laurent Dufour , Michael Ellerman , linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, x86@kernel.org, dave.hansen@linux.intel.com, mingo@redhat.com, bp@alien8.de, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 3/9] cpu/SMT: Store the current/max number of threads In-Reply-To: References: <20230524155630.794584-1-mpe@ellerman.id.au> <20230524155630.794584-3-mpe@ellerman.id.au> <87fs6z80w5.ffs@tglx> Date: Tue, 13 Jun 2023 20:53:56 +0200 Message-ID: <87sfav5h2z.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain 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_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, Jun 13 2023 at 19:16, Laurent Dufour wrote: > On 10/06/2023 23:26:18, Thomas Gleixner wrote: >> On Thu, May 25 2023 at 01:56, Michael Ellerman wrote: >>> #ifdef CONFIG_HOTPLUG_SMT >>> enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED; >>> +static unsigned int cpu_smt_max_threads __ro_after_init; >>> +unsigned int cpu_smt_num_threads; >> >> Why needs this to be global? cpu_smt_control is pointlessly global already. > > I agree that cpu_smt_*_threads should be static. > > Howwever, regarding cpu_smt_control, it is used in 2 places in the x86 code: > - arch/x86/power/hibernate.c in arch_resume_nosmt() > - arch/x86/kernel/cpu/bugs.c in spectre_v2_user_select_mitigation() Bah. I must have fatfingered the grep then. > An accessor function may be introduced to read that value in these 2 > functions, but I'm wondering if that's really the best option. > > Unless there is a real need to change this through this series, I think > cpu_smt_control can remain global. That's fine. Thanks, tglx