linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Peter Zijlstra \(Intel\)" <peterz@infradead.org>,
	"ndesaulniers@google.com" <ndesaulniers@google.com>,
	linux-kernel@vger.kernel.org,
	Rohan McLure <rmclure@linux.ibm.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>
Subject: [PATCH v3 3/5] powerpc/smp: Add __ro_after_init attribute
Date: Thu, 26 Oct 2023 15:48:38 +0530	[thread overview]
Message-ID: <20231026101843.56784-4-srikar@linux.vnet.ibm.com> (raw)
In-Reply-To: <20231026101843.56784-1-srikar@linux.vnet.ibm.com>

There are some variables that are only updated at boot time.
So add __ro_after_init attribute to such variables

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
Changelog:
v2 -> v3:
Use __ro_after_init instead of __read_mostly
Suggested by : Peter Zijlstra and Michael Ellerman

 arch/powerpc/kernel/smp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 9fda012d9eca..27770f7f1ae5 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 __ro_after_init;
+bool coregroup_enabled __ro_after_init;
+bool thread_group_shares_l2 __ro_after_init;
+bool thread_group_shares_l3 __ro_after_init;
 
 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 __ro_after_init;
 /*
  * On shared processor LPARs scheduled on a big core (which has two or more
  * independent thread groups per core), then prefer lower numbered CPUs, so
-- 
2.31.1


  parent reply	other threads:[~2023-10-26 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 10:18 [PATCH v3 0/5] powerpc/smp: Topology and shared processor optimizations Srikar Dronamraju
2023-10-26 10:18 ` [PATCH v3 1/5] powerpc/smp: Enable Asym packing for cores on shared processor Srikar Dronamraju
2023-10-26 10:18 ` [PATCH v3 2/5] powerpc/smp: Disable MC domain for " Srikar Dronamraju
2023-10-26 10:18 ` Srikar Dronamraju [this message]
2023-10-26 10:18 ` [PATCH v3 4/5] powerpc/smp: Avoid asym packing within thread_group of a core Srikar Dronamraju
2023-10-26 10:18 ` [PATCH v3 5/5] powerpc/smp: Dynamically build Powerpc topology Srikar Dronamraju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231026101843.56784-4-srikar@linux.vnet.ibm.com \
    --to=srikar@linux.vnet.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=mpe@ellerman.id.au \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rmclure@linux.ibm.com \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).