Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp121512rdb; Wed, 18 Oct 2023 21:50:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyPz29NYTaPBAJxBg24s5RTiL/WZ8zqdFkJjVEC4m12E55KqTEX6eL/bCb7zMFGQHq4YBp X-Received: by 2002:a54:4806:0:b0:3a7:1d15:28fe with SMTP id j6-20020a544806000000b003a71d1528femr992516oij.56.1697691006223; Wed, 18 Oct 2023 21:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697691006; cv=none; d=google.com; s=arc-20160816; b=eaCE3I1oNOdjWHvyOixj+x3UTnExaB2T3dNuCJCvjJsTY9EEk27naWcZZjk9aesROn U6Z72aq+78IW820ihXresPBbNiQv7GxcuMAOIpl6ZvXIv5MBl7l2eGW9Jxjw+8Gmu84a 9VFxt0ztClNxaSOEx6jcMKo9Qu7Z6Ko2BfseLivKli5iFfcii/zqeTkH20E/hNdegdyi UZqotwaXP0ryYLX6ov3bYwskFwuRqdI5baAglSYhVCNo2jneCVgyH6ozFLXora310GIL GLmA4ghdCDKGa04Acdux0pV63gLRVZ/q6g6WV7RMxvz1LEGVuE/chfAewMLBi/D6Vge7 I0cw== 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=rlQZx9JJxSdr3/h/TbJIqIbao0AYCeJ36JQgRbnJMws=; fh=IPgbFKAbZMj0yk+yv9lHN/ZIdyqImZexc10wt3wC8VY=; b=TSlVVc0CSbHMvrQPpT+0B0K6hwDPkUvCEnA4NhmSR7/paju3XpwqOLEwX7gXOfavZP FZUj8awHh53IpvG9/Ap6hKW85d9mF7Spsp4P/6B847nGJaQiQ2uzah3hEp4vUWPLM13c NlBeZ0CszguQ+qRSOZ0xKoHS+auI1aH9I7Osp1HMCcqEvbdW8U1wXk5L6sjmFNE/F+pB ehyjjZP5gwuyHW0aPk/BOWOJAlKhQ+bdD3PjEuKSRWYYdYFAlSMfS7xgi67ZQ4BND+Ya TVtAU+LAdqWPZsj0wAlgwPDX9cmrTBLf2VoSvgqW5TqsnaeyvVqj+soaNLZ2aC2RrlVF QNig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="Eks/UeYw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b18-20020a63e712000000b005ab6fe9ed79si3458601pgi.755.2023.10.18.21.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 21:50:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="Eks/UeYw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id E9F8D80942D4; Wed, 18 Oct 2023 21:50:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231421AbjJSEtz (ORCPT + 99 others); Thu, 19 Oct 2023 00:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjJSEtx (ORCPT ); Thu, 19 Oct 2023 00:49:53 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5750121 for ; Wed, 18 Oct 2023 21:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1697690988; bh=rlQZx9JJxSdr3/h/TbJIqIbao0AYCeJ36JQgRbnJMws=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Eks/UeYwUxWgNbjQ9pv/zgvRIDI5GwHJohg39vWxMdzp3sOO4ebFRh4gVy+Ous5y2 LRnucQQjKcAdZMedSuMJipgyKyux4AFVShCDjNakwujvQKMJm/lUgyaIxfaily6o+Q OmdrZ0zm/U9bRind8TgK4gML5WA1sjKZYF908uz9KoaA+HyPeQlcavjZHu3j/nAV19 Vw6VQE/8Sb9L4Vn2qhQtjxq9Sp3vcruxlxE8w9HEawnF64di0dzoG2o7HjMD333FoN QcvmexOkPKA1sysVmz1t4tn4k/FG/yVsrzPir6UF82iZlBmZcOKmJCJDrV/q4CFMgV uSsFmtty8f9hQ== 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 4S9wHc3181z4x80; Thu, 19 Oct 2023 15:49:48 +1100 (AEDT) From: Michael Ellerman To: Srikar Dronamraju Cc: linuxppc-dev , Srikar Dronamraju , Christophe Leroy , Nicholas Piggin , Peter Zijlstra , Rohan McLure , Valentin Schneider , Josh Poimboeuf , "ndesaulniers@google.com" , Mark Rutland , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/6] powerpc/smp: Add read_mostly attribute In-Reply-To: <20231018163751.2423181-6-srikar@linux.vnet.ibm.com> References: <20231018163751.2423181-1-srikar@linux.vnet.ibm.com> <20231018163751.2423181-6-srikar@linux.vnet.ibm.com> Date: Thu, 19 Oct 2023 15:49:48 +1100 Message-ID: <87mswf5i8j.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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 21:50:04 -0700 (PDT) Srikar Dronamraju writes: > There are some variables that are only updated at boot time. > So add read_mostly attribute to such variables If they're only updated at boot time then __ro_after_init would be the better annotation. cheers > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c > index 29da9262cb17..b1eb11a66902 100644 > --- a/arch/powerpc/kernel/smp.c > +++ b/arch/powerpc/kernel/smp.c > @@ -77,10 +77,10 @@ static DEFINE_PER_CPU(int, cpu_state) = { 0 }; > #endif > > struct task_struct *secondary_current; > -bool has_big_cores; > -bool coregroup_enabled; > -bool thread_group_shares_l2; > -bool thread_group_shares_l3; > +bool has_big_cores __read_mostly; > +bool coregroup_enabled __read_mostly; > +bool thread_group_shares_l2 __read_mostly; > +bool thread_group_shares_l3 __read_mostly; > > DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map); > DEFINE_PER_CPU(cpumask_var_t, cpu_smallcore_map); > @@ -987,7 +987,7 @@ static int __init init_thread_group_cache_map(int cpu, int cache_property) > return 0; > } > > -static bool shared_caches; > +static bool shared_caches __read_mostly; > DEFINE_STATIC_KEY_FALSE(powerpc_asym_packing); > > #ifdef CONFIG_SCHED_SMT > -- > 2.31.1