mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: kernel-team@meta.com, rostedt@goodmis.org, jgross@suse.com,
	mingo@kernel.org, peterz@infradead.org, corbet@lwn.net,
	"Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH CSDlock 3/4] locking/csd_lock: Remove per-CPU data indirection from CSD lock debugging
Date: Mon, 20 Mar 2023 17:55:15 -0700	[thread overview]
Message-ID: <20230321005516.50558-3-paulmck@kernel.org> (raw)
In-Reply-To: <0c368b66-71b2-442f-a8f7-e6decc4be2d6@paulmck-laptop>

The diagnostics added by this commit were extremely useful in one instance:

a5aabace5fb8 ("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:

de7b09ef658d ("locking/csd_lock: Prepare more CSD lock debugging")

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
---
 kernel/smp.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index 038d666f327b..7a85bcddd9dc 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -31,12 +31,8 @@
 
 #define CSD_TYPE(_csd)	((_csd)->node.u_flags & CSD_FLAG_TYPE_MASK)
 
-struct cfd_percpu {
-	call_single_data_t	csd;
-};
-
 struct call_function_data {
-	struct cfd_percpu	__percpu *pcpu;
+	call_single_data_t	__percpu *csd;
 	cpumask_var_t		cpumask;
 	cpumask_var_t		cpumask_ipi;
 };
@@ -59,8 +55,8 @@ int smpcfd_prepare_cpu(unsigned int cpu)
 		free_cpumask_var(cfd->cpumask);
 		return -ENOMEM;
 	}
-	cfd->pcpu = alloc_percpu(struct cfd_percpu);
-	if (!cfd->pcpu) {
+	cfd->csd = alloc_percpu(call_single_data_t);
+	if (!cfd->csd) {
 		free_cpumask_var(cfd->cpumask);
 		free_cpumask_var(cfd->cpumask_ipi);
 		return -ENOMEM;
@@ -75,7 +71,7 @@ int smpcfd_dead_cpu(unsigned int cpu)
 
 	free_cpumask_var(cfd->cpumask);
 	free_cpumask_var(cfd->cpumask_ipi);
-	free_percpu(cfd->pcpu);
+	free_percpu(cfd->csd);
 	return 0;
 }
 
@@ -730,7 +726,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
 
 		cpumask_clear(cfd->cpumask_ipi);
 		for_each_cpu(cpu, cfd->cpumask) {
-			call_single_data_t *csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd;
+			call_single_data_t *csd = per_cpu_ptr(cfd->csd, cpu);
 
 			if (cond_func && !cond_func(cpu, info))
 				continue;
@@ -774,7 +770,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
 		for_each_cpu(cpu, cfd->cpumask) {
 			call_single_data_t *csd;
 
-			csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd;
+			csd = per_cpu_ptr(cfd->csd, cpu);
 			csd_lock_wait(csd);
 		}
 	}
-- 
2.40.0.rc2


  parent reply	other threads:[~2023-03-21  0:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  0:54 [PATCH RFC smp] Remove diagnostics and adjust config for CSD lock diagnostics Paul E. McKenney
2023-03-21  0:55 ` [PATCH CSDlock 1/4] locking/csd_lock: Add Kconfig option for csd_debug default Paul E. McKenney
2023-03-28  8:34   ` [tip: smp/core] " tip-bot2 for Paul E. McKenney
2023-03-21  0:55 ` [PATCH CSDlock 2/4] locking/csd_lock: Remove added data from CSD lock debugging Paul E. McKenney
2023-03-28  8:34   ` [tip: smp/core] " tip-bot2 for Paul E. McKenney
2023-03-21  0:55 ` Paul E. McKenney [this message]
2023-03-28  8:34   ` [tip: smp/core] locking/csd_lock: Remove per-CPU data indirection " tip-bot2 for Paul E. McKenney
2023-03-21  0:55 ` [PATCH CSDlock 4/4] kernel/smp: Make csdlock_debug= resettable Paul E. McKenney
2023-03-28  8:34   ` [tip: smp/core] " tip-bot2 for Paul E. McKenney
2023-03-28 18:16     ` Paul E. McKenney
2023-03-21  5:46 ` [PATCH RFC smp] Remove diagnostics and adjust config for CSD lock diagnostics Juergen Gross
2023-03-21 10:22 ` Peter Zijlstra
2023-03-21 15:38   ` Paul E. McKenney
2023-03-22  9:57     ` Peter Zijlstra
2023-03-22 14:46       ` Paul E. McKenney

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=20230321005516.50558-3-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=corbet@lwn.net \
    --cc=jgross@suse.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /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

all inboxes | Powered by JetHome®