From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC80CCDB465 for ; Thu, 19 Oct 2023 04:41:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232558AbjJSElr (ORCPT ); Thu, 19 Oct 2023 00:41:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjJSElo (ORCPT ); Thu, 19 Oct 2023 00:41:44 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F71811F for ; Wed, 18 Oct 2023 21:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1697690500; bh=aZD3f3MJzhsJpL8v00FCIVTR80RmPudwdmbBGZ55N60=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=J6FyjU8ZcUqzKfrbX6tvRVugxcuuDAuhQZm7b9zE61MsAnCf5APF7LyescJyN6wZR m1khyZCQYb/ZJSmomAzMQZInm2insvZJDM5l0ZJsR6LKiXPRE7vWag8RxDZVT8L3Rg c32Y5+4JYqlQKndElHkVVephQtpVDDNqG3LwkED0A28En/90Tm7Rqocn7z4UBFnJq0 6uXg/vzi871Xe6qTz6cEK/jaOkU0tIpqozIqty+xr4ybU1YzHiLKRNsH8wbe+i5He8 HLjtmDOw9kIpRAms4NOPuXh+UuNhMrCrklTZ+rbg7GlqCF48yQOGZfMNqy92wYSh4q t6gZAbp6V8vtA== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (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) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4S9w6D66dcz4xPy; Thu, 19 Oct 2023 15:41:40 +1100 (AEDT) From: Michael Ellerman To: Srikar Dronamraju Cc: linuxppc-dev , Srikar Dronamraju , Christophe Leroy , Nicholas Piggin , Peter Zijlstra , Rohan McLure , Valentin Schneider , Ajay Kaher , Alexey Makhalov , VMware PV-Drivers Reviewers , Josh Poimboeuf , virtualization@lists.linux-foundation.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/6] powerpc/smp: Move shared_processor static key to smp.h In-Reply-To: <20231018163751.2423181-4-srikar@linux.vnet.ibm.com> References: <20231018163751.2423181-1-srikar@linux.vnet.ibm.com> <20231018163751.2423181-4-srikar@linux.vnet.ibm.com> Date: Thu, 19 Oct 2023 15:41:40 +1100 Message-ID: <87sf675im3.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Srikar Dronamraju writes: > The ability to detect if the system is running in a shared processor > mode is helpful in few more generic cases not just in > paravirtualization. > For example: At boot time, different scheduler/ topology flags may be > set based on the processor mode. Hence move it to a more generic file. I'd rather you just included paravirt.h in the few files where you need it. cheers > diff --git a/arch/powerpc/include/asm/paravirt.h b/arch/powerpc/include/asm/paravirt.h > index 0372b0093f72..cf83e837a571 100644 > --- a/arch/powerpc/include/asm/paravirt.h > +++ b/arch/powerpc/include/asm/paravirt.h > @@ -15,13 +15,6 @@ > #include > #include > > -DECLARE_STATIC_KEY_FALSE(shared_processor); > - > -static inline bool is_shared_processor(void) > -{ > - return static_branch_unlikely(&shared_processor); > -} > - > #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING > extern struct static_key paravirt_steal_enabled; > extern struct static_key paravirt_steal_rq_enabled; > @@ -77,11 +70,6 @@ static inline bool is_vcpu_idle(int vcpu) > return lppaca_of(vcpu).idle; > } > #else > -static inline bool is_shared_processor(void) > -{ > - return false; > -} > - > static inline u32 yield_count_of(int cpu) > { > return 0; > diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h > index aaaa576d0e15..08631b2a4528 100644 > --- a/arch/powerpc/include/asm/smp.h > +++ b/arch/powerpc/include/asm/smp.h > @@ -34,6 +34,20 @@ extern bool coregroup_enabled; > extern int cpu_to_chip_id(int cpu); > extern int *chip_id_lookup_table; > > +#ifdef CONFIG_PPC_SPLPAR > +DECLARE_STATIC_KEY_FALSE(shared_processor); > + > +static inline bool is_shared_processor(void) > +{ > + return static_branch_unlikely(&shared_processor); > +} > +#else > +static inline bool is_shared_processor(void) > +{ > + return false; > +} > +#endif > + > DECLARE_PER_CPU(cpumask_var_t, thread_group_l1_cache_map); > DECLARE_PER_CPU(cpumask_var_t, thread_group_l2_cache_map); > DECLARE_PER_CPU(cpumask_var_t, thread_group_l3_cache_map); > -- > 2.31.1