Skip to content

Commit 6366d06

Browse files
paulmckrcuPeter Zijlstra
authored andcommitted
locking/csd_lock: Remove per-CPU data indirection from CSD lock debugging
The diagnostics added by this commit were extremely useful in one instance: a5aabac ("locking/csd_lock: Add more data to CSD lock debugging") However, they have not seen much action since, and there have been some concerns expressed that the complexity is not worth the benefit. Therefore, manually revert the following commit preparatory commit: de7b09e ("locking/csd_lock: Prepare more CSD lock debugging") Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20230321005516.50558-3-paulmck@kernel.org
1 parent 1771257 commit 6366d06

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

kernel/smp.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,8 @@
3131

3232
#define CSD_TYPE(_csd) ((_csd)->node.u_flags & CSD_FLAG_TYPE_MASK)
3333

34-
struct cfd_percpu {
35-
call_single_data_t csd;
36-
};
37-
3834
struct call_function_data {
39-
struct cfd_percpu __percpu *pcpu;
35+
call_single_data_t __percpu *csd;
4036
cpumask_var_t cpumask;
4137
cpumask_var_t cpumask_ipi;
4238
};
@@ -59,8 +55,8 @@ int smpcfd_prepare_cpu(unsigned int cpu)
5955
free_cpumask_var(cfd->cpumask);
6056
return -ENOMEM;
6157
}
62-
cfd->pcpu = alloc_percpu(struct cfd_percpu);
63-
if (!cfd->pcpu) {
58+
cfd->csd = alloc_percpu(call_single_data_t);
59+
if (!cfd->csd) {
6460
free_cpumask_var(cfd->cpumask);
6561
free_cpumask_var(cfd->cpumask_ipi);
6662
return -ENOMEM;
@@ -75,7 +71,7 @@ int smpcfd_dead_cpu(unsigned int cpu)
7571

7672
free_cpumask_var(cfd->cpumask);
7773
free_cpumask_var(cfd->cpumask_ipi);
78-
free_percpu(cfd->pcpu);
74+
free_percpu(cfd->csd);
7975
return 0;
8076
}
8177

@@ -730,7 +726,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
730726

731727
cpumask_clear(cfd->cpumask_ipi);
732728
for_each_cpu(cpu, cfd->cpumask) {
733-
call_single_data_t *csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd;
729+
call_single_data_t *csd = per_cpu_ptr(cfd->csd, cpu);
734730

735731
if (cond_func && !cond_func(cpu, info))
736732
continue;
@@ -774,7 +770,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
774770
for_each_cpu(cpu, cfd->cpumask) {
775771
call_single_data_t *csd;
776772

777-
csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd;
773+
csd = per_cpu_ptr(cfd->csd, cpu);
778774
csd_lock_wait(csd);
779775
}
780776
}

0 commit comments

Comments
 (0)