Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp119506rdb; Wed, 18 Oct 2023 21:41:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGo0oZ1pi9DfGoZqPGNJpvqIBMOazI9aexXA46UV3o9kb9NKpjMNIH7+qU8hmLSb+y6a/Ds X-Received: by 2002:a17:902:e809:b0:1ca:4092:7200 with SMTP id u9-20020a170902e80900b001ca40927200mr1325078plg.54.1697690514871; Wed, 18 Oct 2023 21:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697690514; cv=none; d=google.com; s=arc-20160816; b=o5bQ051YgQv2nEvt2QFY8ZarQps9DqSQsDgAuiPhzYo1GtITutgjIz62dTDWr1UwF3 hr8bl0atu8GQGnLCK8WSEK99iaH3DuELAgQqSYb+JXVVJ72iybCrJoq4qhhL3NzP3Zjp a3w4UO0jcHuvauHsnB3FOCNehrXiB803naQCT2kmcB9mVVHqjJXrFmWGoqFvrUsnA65R vNcRDrrjPy5vJrHgL3TCrFjuGSs1+QSWU7PivFJIXDDA4jVUi85cPMF/chBoC5sQkO6T SiXQTWPVdGGpcJu57ZGlBZoQP53IKugydRE5nTVaq6BCtwny2z6ZzVwJMSiELqJf9MBa aXVw== 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:from:dkim-signature; bh=aZD3f3MJzhsJpL8v00FCIVTR80RmPudwdmbBGZ55N60=; fh=MYh0QqyzuL5CTf/I7AxaxGwlbUalez/CEa8ht6RqRNs=; b=l2xLBZ5goXbhChKs8SBUtYYneh6MzI7NIyCzxpNcezVuXPoDrcHTKo64qvs3Z9Gn/L qENon+uJh5up2et9RdsDJlU+9SIgfVyegjIYQcwmwmtgXyBkm/CTQcbZb1FN/CEmnXYX M3PWkYmClVEw8TjrAN4MyrxigrE69Id6q5FjwSQflwSPCctOe3SShQ0Au8Z4wV7QlB4G NuHJF89WvyLu0OzSzmLwBlVa9UhELiUhiUmpPFUWbOvVIk8PSp2iPXmyMNLwgOcS9ohu x12m2j7W3M83VZWREDY5JxVhBOCEBX3aGzQlXewp8CAJ5lUx3dNQpWdEyz0lKOTXSP96 WCeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=J6FyjU8Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id f8-20020a170902ce8800b001c7615a8e09si1423716plg.593.2023.10.18.21.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 21:41:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=J6FyjU8Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 70AF2826D94F; Wed, 18 Oct 2023 21:41:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231709AbjJSElq (ORCPT + 99 others); Thu, 19 Oct 2023 00:41:46 -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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 21:41:52 -0700 (PDT) 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