[PATCH 34/41] x86/alternatives: Rename 'int3_refs' to 'tp_array_refs'
From: Ingo Molnar
Date: Thu Mar 27 2025 - 17:03:59 EST
Make it clear that these reference counts lock access
to tp_array.
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
arch/x86/kernel/alternative.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 6c3850527bd5..3ab40b0f5245 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -2473,11 +2473,11 @@ static struct text_poke_int3_array {
struct text_poke_int3_loc vec[TP_ARRAY_NR_ENTRIES_MAX];
} tp_array;
-static DEFINE_PER_CPU(atomic_t, int3_refs);
+static DEFINE_PER_CPU(atomic_t, tp_array_refs);
static bool try_get_tp_array(void)
{
- atomic_t *refs = this_cpu_ptr(&int3_refs);
+ atomic_t *refs = this_cpu_ptr(&tp_array_refs);
if (!raw_atomic_inc_not_zero(refs))
return false;
@@ -2487,7 +2487,7 @@ static bool try_get_tp_array(void)
static __always_inline void put_tp_array(void)
{
- atomic_t *refs = this_cpu_ptr(&int3_refs);
+ atomic_t *refs = this_cpu_ptr(&tp_array_refs);
smp_mb__before_atomic();
raw_atomic_dec(refs);
@@ -2522,9 +2522,9 @@ noinstr int text_poke_int3_handler(struct pt_regs *regs)
* Having observed our INT3 instruction, we now must observe
* tp_array with non-zero refcount:
*
- * int3_refs = 1 INT3
+ * tp_array_refs = 1 INT3
* WMB RMB
- * write INT3 if (int3_refs != 0)
+ * write INT3 if (tp_array_refs != 0)
*/
smp_rmb();
@@ -2623,7 +2623,7 @@ static void text_poke_int3_batch_process(void)
* ensure reading a non-zero refcount provides up to date tp_array data.
*/
for_each_possible_cpu(i)
- atomic_set_release(per_cpu_ptr(&int3_refs, i), 1);
+ atomic_set_release(per_cpu_ptr(&tp_array_refs, i), 1);
/*
* Function tracing can enable thousands of places that need to be
@@ -2745,7 +2745,7 @@ static void text_poke_int3_batch_process(void)
* unused.
*/
for_each_possible_cpu(i) {
- atomic_t *refs = per_cpu_ptr(&int3_refs, i);
+ atomic_t *refs = per_cpu_ptr(&tp_array_refs, i);
if (unlikely(!atomic_dec_and_test(refs)))
atomic_cond_read_acquire(refs, !VAL);
--
2.45.2