Skip to content

Commit 396716b

Browse files
committed
locking/csd_lock: Remove per-CPU data indirection from CSD lock debugging
JIRA: https://issues.redhat.com/browse/RHEL-16867 Conflicts: A context diff in the smp_call_function_many_cond() hunk due to the presence of a later upstream commit 5c31249 ("trace,smp: Trace all smp_function_call*() invocations"). commit 6366d06 Author: Paul E. McKenney <paulmck@kernel.org> Date: Mon, 20 Mar 2023 17:55:15 -0700 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 Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 883f1ec commit 396716b

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

kernel/smp.c

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

3737
#define CSD_TYPE(_csd) ((_csd)->node.u_flags & CSD_FLAG_TYPE_MASK)
3838

39-
struct cfd_percpu {
40-
call_single_data_t csd;
41-
};
42-
4339
struct call_function_data {
44-
struct cfd_percpu __percpu *pcpu;
40+
call_single_data_t __percpu *csd;
4541
cpumask_var_t cpumask;
4642
cpumask_var_t cpumask_ipi;
4743
};
@@ -64,8 +60,8 @@ int smpcfd_prepare_cpu(unsigned int cpu)
6460
free_cpumask_var(cfd->cpumask);
6561
return -ENOMEM;
6662
}
67-
cfd->pcpu = alloc_percpu(struct cfd_percpu);
68-
if (!cfd->pcpu) {
63+
cfd->csd = alloc_percpu(call_single_data_t);
64+
if (!cfd->csd) {
6965
free_cpumask_var(cfd->cpumask);
7066
free_cpumask_var(cfd->cpumask_ipi);
7167
return -ENOMEM;
@@ -80,7 +76,7 @@ int smpcfd_dead_cpu(unsigned int cpu)
8076

8177
free_cpumask_var(cfd->cpumask);
8278
free_cpumask_var(cfd->cpumask_ipi);
83-
free_percpu(cfd->pcpu);
79+
free_percpu(cfd->csd);
8480
return 0;
8581
}
8682

@@ -780,7 +776,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
780776

781777
cpumask_clear(cfd->cpumask_ipi);
782778
for_each_cpu(cpu, cfd->cpumask) {
783-
call_single_data_t *csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd;
779+
call_single_data_t *csd = per_cpu_ptr(cfd->csd, cpu);
784780

785781
if (cond_func && !cond_func(cpu, info)) {
786782
__cpumask_clear_cpu(cpu, cfd->cpumask);
@@ -828,7 +824,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
828824
for_each_cpu(cpu, cfd->cpumask) {
829825
call_single_data_t *csd;
830826

831-
csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd;
827+
csd = per_cpu_ptr(cfd->csd, cpu);
832828
csd_lock_wait(csd);
833829
}
834830
}

0 commit comments

Comments
 (0)