Skip to contentSkip to conversation

Remove diagnostics and adjust config for CSD lock diagnostics

RFC PATCH In review Paul E. McKenney 4 participants 15 messages Mar 21, 2023 – Mar 28, 2023

Subsystems (3)
lore
Share & tools
lore

Paul E. McKenney

author maintainer
#0 lore raw

RFC PATCH 1/1 Remove diagnostics and adjust config for CSD lock diagnostics

Hello!

This series removes CSD-lock diagnostics that were once very useful but which have not seen much action since. It also adjusts Kconfig and kernel-boot-parameter setup.

1. locking/csd_lock: Add Kconfig option for csd_debug default.

2. locking/csd_lock: Remove added data from CSD lock debugging.

3. locking/csd_lock: Remove per-CPU data indirection from CSD
lock debugging.

4. kernel/smp: Make csdlock_debug= resettable.

Thanx, Paul

------------------------------------------------------------------------

 Documentation/admin-guide/kernel-parameters.txt   |   17 -
 b/Documentation/admin-guide/kernel-parameters.txt |    6 
 b/kernel/smp.c                                    |    2 
 b/lib/Kconfig.debug                               |    9 
 kernel/smp.c                                      |  260 ++--------------------
 5 files changed, 47 insertions(+), 247 deletions(-)
author maintainer
#1 lore raw

PATCH 1/4 locking/csd_lock: Add Kconfig option for csd_debug default

The csd_debug kernel parameter works well, but is inconvenient in cases where it is more closely associated with boot loaders or automation than with a particular kernel version or release. Thererfore, provide a new CSD_LOCK_WAIT_DEBUG_DEFAULT Kconfig option that defaults csd_debug to 1 when selected and 0 otherwise, with this latter being the default.

Cc Juergen Gross <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Ingo Molnar <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt | 6 ++++--
 kernel/smp.c                                    | 2 +-
 lib/Kconfig.debug                               | 9 +++++++++
 3 files changed, 14 insertions(+), 3 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +4 -2
index 6221a1d057dd..ce70777f5999 100644
@@ -893,8 +893,10 @@
 			handling. When switched on, additional debug data is
 			printed to the console in case a hanging CPU is
 			detected, and that CPU is pinged again in order to try
-			to resolve the hang situation.
-			0: disable csdlock debugging (default)
+			to resolve the hang situation.  The default value of
+			this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
+			Kconfig option.
+			0: disable csdlock debugging
 			1: enable basic csdlock debugging (minor impact)
 			ext: enable extended csdlock debugging (more impact,
 			     but more data)
kernel/smp.c +1 -1
index 06a413987a14..e2d558f5cef8 100644
@@ -158,7 +158,7 @@ void __init call_function_init(void)
 
 #ifdef CONFIG_CSD_LOCK_WAIT_DEBUG
 
-static DEFINE_STATIC_KEY_FALSE(csdlock_debug_enabled);
+static DEFINE_STATIC_KEY_MAYBE(CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT, csdlock_debug_enabled);
 static DEFINE_STATIC_KEY_FALSE(csdlock_debug_extended);
 
 static int __init csdlock_debug(char *str)
lib/Kconfig.debug +9 -0
index c8b379e2e9ad..e1b160a0474d 100644
@@ -1480,6 +1480,15 @@ config CSD_LOCK_WAIT_DEBUG
 	  include the IPI handler function currently executing (if any)
 	  and relevant stack traces.
 
+config CSD_LOCK_WAIT_DEBUG_DEFAULT
+	bool "Default csd_lock_wait() debugging on at boot time"
+	depends on CSD_LOCK_WAIT_DEBUG
+	depends on 64BIT
+	default n
+	help
+	  This option causes the csdlock_debug= kernel boot parameter to
+	  default to 1 (basic debugging) instead of 0 (no debugging).
+
 endmenu # lock debugging
 
 config TRACE_IRQFLAGS
Signature · 1 line
2.40.0.rc2
#2 lore raw

[tip: smp/core] locking/csd_lock: Add Kconfig option for csd_debug default

The following commit has been merged into the smp/core branch of tip:

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     c52198601695851622f361d3f16456e9fc857629
Gitweb:        https://git.kernel.org/tip/c52198601695851622f361d3f16456e9fc857629
Author:        Paul E. McKenney <[email protected]>
AuthorDate:    Mon, 20 Mar 2023 17:55:13 -07:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Fri, 24 Mar 2023 11:01:25 +01:00

locking/csd_lock: Add Kconfig option for csd_debug default

The csd_debug kernel parameter works well, but is inconvenient in cases where it is more closely associated with boot loaders or automation than with a particular kernel version or release. Thererfore, provide a new CSD_LOCK_WAIT_DEBUG_DEFAULT Kconfig option that defaults csd_debug to 1 when selected and 0 otherwise, with this latter being the default.

---
 Documentation/admin-guide/kernel-parameters.txt |  6 ++++--
 kernel/smp.c                                    |  2 +-
 lib/Kconfig.debug                               |  9 +++++++++
 3 files changed, 14 insertions(+), 3 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +4 -2
index 6221a1d..ce70777 100644
@@ -893,8 +893,10 @@
 			handling. When switched on, additional debug data is
 			printed to the console in case a hanging CPU is
 			detected, and that CPU is pinged again in order to try
-			to resolve the hang situation.
-			0: disable csdlock debugging (default)
+			to resolve the hang situation.  The default value of
+			this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
+			Kconfig option.
+			0: disable csdlock debugging
 			1: enable basic csdlock debugging (minor impact)
 			ext: enable extended csdlock debugging (more impact,
 			     but more data)
kernel/smp.c +1 -1
index 06a4139..e2d558f 100644
@@ -158,7 +158,7 @@ void __init call_function_init(void)
 
 #ifdef CONFIG_CSD_LOCK_WAIT_DEBUG
 
-static DEFINE_STATIC_KEY_FALSE(csdlock_debug_enabled);
+static DEFINE_STATIC_KEY_MAYBE(CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT, csdlock_debug_enabled);
 static DEFINE_STATIC_KEY_FALSE(csdlock_debug_extended);
 
 static int __init csdlock_debug(char *str)
lib/Kconfig.debug +9 -0
index c8b379e..e1b160a 100644
@@ -1480,6 +1480,15 @@ config CSD_LOCK_WAIT_DEBUG
 	  include the IPI handler function currently executing (if any)
 	  and relevant stack traces.
 
+config CSD_LOCK_WAIT_DEBUG_DEFAULT
+	bool "Default csd_lock_wait() debugging on at boot time"
+	depends on CSD_LOCK_WAIT_DEBUG
+	depends on 64BIT
+	default n
+	help
+	  This option causes the csdlock_debug= kernel boot parameter to
+	  default to 1 (basic debugging) instead of 0 (no debugging).
+
 endmenu # lock debugging
 
 config TRACE_IRQFLAGS
author maintainer
#3 lore raw

PATCH 2/4 locking/csd_lock: Remove added data from CSD lock debugging

In reply to Paul E. McKenney

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 this commit, but leave a comment telling people where to find these diagnostics.

[ paulmck: Apply Juergen Gross feedback. ]

Cc Juergen Gross <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 .../admin-guide/kernel-parameters.txt         |   4 -
 kernel/smp.c                                  | 233 +-----------------
 2 files changed, 12 insertions(+), 225 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +0 -4
index ce70777f5999..b15198a85acb 100644
@@ -896,10 +896,6 @@
 			to resolve the hang situation.  The default value of
 			this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
 			Kconfig option.
-			0: disable csdlock debugging
-			1: enable basic csdlock debugging (minor impact)
-			ext: enable extended csdlock debugging (more impact,
-			     but more data)
 
 	dasd=		[HW,NET]
 			See header of drivers/s390/block/dasd_devmap.c.
kernel/smp.c +12 -221

345 lines not on this page · raw message

Signature · 1 line
2.40.0.rc2
#4 lore raw

[tip: smp/core] locking/csd_lock: Remove added data from CSD lock debugging

The following commit has been merged into the smp/core branch of tip:

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     1771257cb447a7b27a15ed9aaf332726c47fcbcf
Gitweb:        https://git.kernel.org/tip/1771257cb447a7b27a15ed9aaf332726c47fcbcf
Author:        Paul E. McKenney <[email protected]>
AuthorDate:    Mon, 20 Mar 2023 17:55:14 -07:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Fri, 24 Mar 2023 11:01:25 +01:00

locking/csd_lock: Remove added data from CSD lock debugging

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 this commit, but leave a comment telling people where to find these diagnostics.

[ paulmck: Apply Juergen Gross feedback. ]

---
 Documentation/admin-guide/kernel-parameters.txt |   4 +-
 kernel/smp.c                                    | 233 +---------------
 2 files changed, 12 insertions(+), 225 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +0 -4
index ce70777..b15198a 100644
@@ -896,10 +896,6 @@
 			to resolve the hang situation.  The default value of
 			this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
 			Kconfig option.
-			0: disable csdlock debugging
-			1: enable basic csdlock debugging (minor impact)
-			ext: enable extended csdlock debugging (more impact,
-			     but more data)
 
 	dasd=		[HW,NET]
 			See header of drivers/s390/block/dasd_devmap.c.
kernel/smp.c +12 -221

345 lines not on this page · raw message

author maintainer
#5 lore raw

PATCH 3/4 locking/csd_lock: Remove per-CPU data indirection from CSD lock debugging

In reply to Paul E. McKenney

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")

Cc Juergen Gross <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 kernel/smp.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
kernel/smp.c +6 -10
index 038d666f327b..7a85bcddd9dc 100644
@@ -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);
 		}
 	}
Signature · 1 line
2.40.0.rc2
#6 lore raw

[tip: smp/core] locking/csd_lock: Remove per-CPU data indirection from CSD lock debugging

The following commit has been merged into the smp/core branch of tip:

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     6366d062e7f97499409979f23f4107a6c45edb04
Gitweb:        https://git.kernel.org/tip/6366d062e7f97499409979f23f4107a6c45edb04
Author:        Paul E. McKenney <[email protected]>
AuthorDate:    Mon, 20 Mar 2023 17:55:15 -07:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Fri, 24 Mar 2023 11:01:26 +01:00

locking/csd_lock: Remove per-CPU data indirection from CSD lock debugging

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")

---
 kernel/smp.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
kernel/smp.c +6 -10
index 038d666..7a85bcd 100644
@@ -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);
 		}
 	}
author maintainer
#7 lore raw

PATCH 4/4 kernel/smp: Make csdlock_debug= resettable

In reply to Paul E. McKenney

It is currently possible to set the csdlock_debug_enabled static branch, but not to reset it. This is an issue when several different entities supply kernel boot parameters and also for kernels built with CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT=y.

Therefore, make the csdlock_debug=0 kernel boot parameter turn off debugging. Last one wins!

---
 Documentation/admin-guide/kernel-parameters.txt | 13 +++++++------
 kernel/smp.c                                    | 11 ++++++++---
 2 files changed, 15 insertions(+), 9 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +7 -6
index b15198a85acb..5f2ec4b0f927 100644
@@ -889,12 +889,13 @@
 	cs89x0_media=	[HW,NET]
 			Format: { rj45 | aui | bnc }
 
-	csdlock_debug=	[KNL] Enable debug add-ons of cross-CPU function call
-			handling. When switched on, additional debug data is
-			printed to the console in case a hanging CPU is
-			detected, and that CPU is pinged again in order to try
-			to resolve the hang situation.  The default value of
-			this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
+	csdlock_debug=	[KNL] Enable or disable debug add-ons of cross-CPU
+			function call handling. When switched on,
+			additional debug data is printed to the console
+			in case a hanging CPU is detected, and that
+			CPU is pinged again in order to try to resolve
+			the hang situation.  The default value of this
+			option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
 			Kconfig option.
 
 	dasd=		[HW,NET]
kernel/smp.c +8 -3
index 7a85bcddd9dc..298ba7570621 100644
@@ -116,11 +116,16 @@ static DEFINE_STATIC_KEY_MAYBE(CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT, csdlock_debug
  */
 static int __init csdlock_debug(char *str)
 {
+	int ret;
 	unsigned int val = 0;
 
-	get_option(&str, &val);
-	if (val)
-		static_branch_enable(&csdlock_debug_enabled);
+	ret = get_option(&str, &val);
+	if (ret) {
+		if (val)
+			static_branch_enable(&csdlock_debug_enabled);
+		else
+			static_branch_disable(&csdlock_debug_enabled);
+	}
 
 	return 1;
 }
Signature · 1 line
2.40.0.rc2
#8 lore raw

[tip: smp/core] kernel/smp: Make csdlock_debug= resettable

The following commit has been merged into the smp/core branch of tip:

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     203e435844734cfa503cd1755f35db2514db5cca
Gitweb:        https://git.kernel.org/tip/203e435844734cfa503cd1755f35db2514db5cca
Author:        Paul E. McKenney <[email protected]>
AuthorDate:    Mon, 20 Mar 2023 17:55:16 -07:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Fri, 24 Mar 2023 11:01:26 +01:00

kernel/smp: Make csdlock_debug= resettable

It is currently possible to set the csdlock_debug_enabled static branch, but not to reset it. This is an issue when several different entities supply kernel boot parameters and also for kernels built with CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT=y.

Therefore, make the csdlock_debug=0 kernel boot parameter turn off debugging. Last one wins!

---
 Documentation/admin-guide/kernel-parameters.txt | 13 +++++++------
 kernel/smp.c                                    | 11 ++++++++---
 2 files changed, 15 insertions(+), 9 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +7 -6
index b15198a..5f2ec4b 100644
@@ -889,12 +889,13 @@
 	cs89x0_media=	[HW,NET]
 			Format: { rj45 | aui | bnc }
 
-	csdlock_debug=	[KNL] Enable debug add-ons of cross-CPU function call
-			handling. When switched on, additional debug data is
-			printed to the console in case a hanging CPU is
-			detected, and that CPU is pinged again in order to try
-			to resolve the hang situation.  The default value of
-			this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
+	csdlock_debug=	[KNL] Enable or disable debug add-ons of cross-CPU
+			function call handling. When switched on,
+			additional debug data is printed to the console
+			in case a hanging CPU is detected, and that
+			CPU is pinged again in order to try to resolve
+			the hang situation.  The default value of this
+			option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
 			Kconfig option.
 
 	dasd=		[HW,NET]
kernel/smp.c +8 -3
index 7a85bcd..298ba75 100644
@@ -116,11 +116,16 @@ static DEFINE_STATIC_KEY_MAYBE(CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT, csdlock_debug
  */
 static int __init csdlock_debug(char *str)
 {
+	int ret;
 	unsigned int val = 0;
 
-	get_option(&str, &val);
-	if (val)
-		static_branch_enable(&csdlock_debug_enabled);
+	ret = get_option(&str, &val);
+	if (ret) {
+		if (val)
+			static_branch_enable(&csdlock_debug_enabled);
+		else
+			static_branch_disable(&csdlock_debug_enabled);
+	}
 
 	return 1;
 }
author maintainer
#9 lore raw

Re: [tip: smp/core] kernel/smp: Make csdlock_debug= resettable

Quoted 10 lines · On Tue, Mar 28, 2023 at 08:34:46AM -0000, tip-bot2 for Paul E. McKenney wrote:

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     203e435844734cfa503cd1755f35db2514db5cca
Gitweb:        https://git.kernel.org/tip/203e435844734cfa503cd1755f35db2514db5cca
Author:        Paul E. McKenney <[email protected]>
AuthorDate:    Mon, 20 Mar 2023 17:55:16 -07:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Fri, 24 Mar 2023 11:01:26 +01:00

kernel/smp: Make csdlock_debug= resettable

Very good, thank you! I have removed these from the -rcu tree's "dev" branch, and if testing goes well will be sending the new version to -next.

Thanx, Paul

Quoted 66 lines

It is currently possible to set the csdlock_debug_enabled static branch, but not to reset it. This is an issue when several different entities supply kernel boot parameters and also for kernels built with CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT=y.

Therefore, make the csdlock_debug=0 kernel boot parameter turn off debugging. Last one wins!

---
 Documentation/admin-guide/kernel-parameters.txt | 13 +++++++------
 kernel/smp.c                                    | 11 ++++++++---
 2 files changed, 15 insertions(+), 9 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +7 -6
index b15198a..5f2ec4b 100644
@@ -889,12 +889,13 @@
 	cs89x0_media=	[HW,NET]
 			Format: { rj45 | aui | bnc }
 
-	csdlock_debug=	[KNL] Enable debug add-ons of cross-CPU function call
-			handling. When switched on, additional debug data is
-			printed to the console in case a hanging CPU is
-			detected, and that CPU is pinged again in order to try
-			to resolve the hang situation.  The default value of
-			this option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
+	csdlock_debug=	[KNL] Enable or disable debug add-ons of cross-CPU
+			function call handling. When switched on,
+			additional debug data is printed to the console
+			in case a hanging CPU is detected, and that
+			CPU is pinged again in order to try to resolve
+			the hang situation.  The default value of this
+			option depends on the CSD_LOCK_WAIT_DEBUG_DEFAULT
 			Kconfig option.
 
 	dasd=		[HW,NET]
kernel/smp.c +8 -3
index 7a85bcd..298ba75 100644
@@ -116,11 +116,16 @@ static DEFINE_STATIC_KEY_MAYBE(CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT, csdlock_debug
  */
 static int __init csdlock_debug(char *str)
 {
+	int ret;
 	unsigned int val = 0;
 
-	get_option(&str, &val);
-	if (val)
-		static_branch_enable(&csdlock_debug_enabled);
+	ret = get_option(&str, &val);
+	if (ret) {
+		if (val)
+			static_branch_enable(&csdlock_debug_enabled);
+		else
+			static_branch_disable(&csdlock_debug_enabled);
+	}
 
 	return 1;
 }
Acked-by on v1 1/1
#10 lore raw
In reply to Paul E. McKenney
Quoted 17 lines · Paul E. McKenney

Hello!

This series removes CSD-lock diagnostics that were once very useful but which have not seen much action since. It also adjusts Kconfig and kernel-boot-parameter setup.

1. locking/csd_lock: Add Kconfig option for csd_debug default.

2. locking/csd_lock: Remove added data from CSD lock debugging.

3. locking/csd_lock: Remove per-CPU data indirection from CSD
lock debugging.

4. kernel/smp: Make csdlock_debug= resettable.

Thanx, Paul

Quoted 8 lines

------------------------------------------------------------------------

  Documentation/admin-guide/kernel-parameters.txt   |   17 -
  b/Documentation/admin-guide/kernel-parameters.txt |    6
  b/kernel/smp.c                                    |    2
  b/lib/Kconfig.debug                               |    9
  kernel/smp.c                                      |  260 ++--------------------
  5 files changed, 47 insertions(+), 247 deletions(-)

For the series:

Juergen

#11 lore raw
In reply to Paul E. McKenney
Quoted 17 lines · Paul E. McKenney

Hello!

This series removes CSD-lock diagnostics that were once very useful but which have not seen much action since. It also adjusts Kconfig and kernel-boot-parameter setup.

1. locking/csd_lock: Add Kconfig option for csd_debug default.

2. locking/csd_lock: Remove added data from CSD lock debugging.

3. locking/csd_lock: Remove per-CPU data indirection from CSD
lock debugging.

4. kernel/smp: Make csdlock_debug= resettable.

Thanx, Paul

Quoted 8 lines

------------------------------------------------------------------------

 Documentation/admin-guide/kernel-parameters.txt   |   17 -
 b/Documentation/admin-guide/kernel-parameters.txt |    6 
 b/kernel/smp.c                                    |    2 
 b/lib/Kconfig.debug                               |    9 
 kernel/smp.c                                      |  260 ++--------------------
 5 files changed, 47 insertions(+), 247 deletions(-)

Yay!! How do you want to route these, should I take them through tip?

What about the rest of the thing? Your commits seem to suggest it's still actually used -- why? Are there still more virt bugs?

author maintainer
#12 lore raw
Quoted 20 lines · Peter Zijlstra
Quoted 19 lines · Paul E. McKenney

Hello!

This series removes CSD-lock diagnostics that were once very useful but which have not seen much action since. It also adjusts Kconfig and kernel-boot-parameter setup.

1. locking/csd_lock: Add Kconfig option for csd_debug default.

2. locking/csd_lock: Remove added data from CSD lock debugging.

3. locking/csd_lock: Remove per-CPU data indirection from CSD
lock debugging.

4. kernel/smp: Make csdlock_debug= resettable.

Thanx, Paul

------------------------------------------------------------------------

Quoted 8 lines
Quoted 6 lines
 Documentation/admin-guide/kernel-parameters.txt   |   17 -
 b/Documentation/admin-guide/kernel-parameters.txt |    6 
 b/kernel/smp.c                                    |    2 
 b/lib/Kconfig.debug                               |    9 
 kernel/smp.c                                      |  260 ++--------------------
 5 files changed, 47 insertions(+), 247 deletions(-)

Yay!! How do you want to route these, should I take them through tip?

Either way works for me. If you take them into -tip, I will drop them from -rcu. If you don't take them into -tip, I will send Linus a pull request for the upcoming merge window. And if you take them at just the wrong time, we will both send them to Linus. ;-)

Your choice!

Quoted 2 lines

What about the rest of the thing? Your commits seem to suggest it's still actually used -- why? Are there still more virt bugs?

Thus far, no luck. I proposed ditching some of the stack traces, but that got shot down.

These find the following issues: (1) CPU looping with interrupts disabled. (2) CPU stuck in a longer-than-average SMI handler or other firmware sand trap. (3) CPU fail stopped.

In theory, we could drop the RCU CPU stall warning to five seconds and catch this same stuff. Unfortunately, in practice, there would need to be lots of churn from CPUs looping with preemption disabled. Which we still get from time to time even at 21 seconds.

NMIs can be used to deal with #1, and the hard lockup detector in fact sort of does this. But these are not helpful for #2 and #3.

So nothing yet, but I am still looking for improved diagnostics.

Thanx, Paul

#13 lore raw
Quoted 28 lines · Paul E. McKenney
Quoted 27 lines · Peter Zijlstra
Quoted 25 lines · Paul E. McKenney

Hello!

This series removes CSD-lock diagnostics that were once very useful but which have not seen much action since. It also adjusts Kconfig and kernel-boot-parameter setup.

1. locking/csd_lock: Add Kconfig option for csd_debug default.

2. locking/csd_lock: Remove added data from CSD lock debugging.

3. locking/csd_lock: Remove per-CPU data indirection from CSD
lock debugging.

4. kernel/smp: Make csdlock_debug= resettable.

Thanx, Paul

------------------------------------------------------------------------

 Documentation/admin-guide/kernel-parameters.txt   |   17 -
 b/Documentation/admin-guide/kernel-parameters.txt |    6 
 b/kernel/smp.c                                    |    2 
 b/lib/Kconfig.debug                               |    9 
 kernel/smp.c                                      |  260 ++--------------------
 5 files changed, 47 insertions(+), 247 deletions(-)
Quoted 8 lines
Quoted 1 line

Yay!! How do you want to route these, should I take them through tip?

Either way works for me. If you take them into -tip, I will drop them from -rcu. If you don't take them into -tip, I will send Linus a pull request for the upcoming merge window. And if you take them at just the wrong time, we will both send them to Linus. ;-)

Your choice!

OK, since they conflict a wee bit with Valentin's IPI tracepoint stuff, I'm probably going to take both these series, let me stomp on the conflict and feed it to the robots to see how bad it all gets :-)

I'll let you know if/when i'll push them to -tip.

author maintainer
#14 lore raw
Quoted 36 lines · Peter Zijlstra
Quoted 35 lines · Paul E. McKenney
Quoted 20 lines · Peter Zijlstra
Quoted 19 lines · Paul E. McKenney

Hello!

This series removes CSD-lock diagnostics that were once very useful but which have not seen much action since. It also adjusts Kconfig and kernel-boot-parameter setup.

1. locking/csd_lock: Add Kconfig option for csd_debug default.

2. locking/csd_lock: Remove added data from CSD lock debugging.

3. locking/csd_lock: Remove per-CPU data indirection from CSD
lock debugging.

4. kernel/smp: Make csdlock_debug= resettable.

Thanx, Paul

------------------------------------------------------------------------

Quoted 8 lines
Quoted 6 lines
 Documentation/admin-guide/kernel-parameters.txt   |   17 -
 b/Documentation/admin-guide/kernel-parameters.txt |    6 
 b/kernel/smp.c                                    |    2 
 b/lib/Kconfig.debug                               |    9 
 kernel/smp.c                                      |  260 ++--------------------
 5 files changed, 47 insertions(+), 247 deletions(-)

Yay!! How do you want to route these, should I take them through tip?

Either way works for me. If you take them into -tip, I will drop them from -rcu. If you don't take them into -tip, I will send Linus a pull request for the upcoming merge window. And if you take them at just the wrong time, we will both send them to Linus. ;-)

Quoted 7 lines
Quoted 1 line

Your choice!

OK, since they conflict a wee bit with Valentin's IPI tracepoint stuff, I'm probably going to take both these series, let me stomp on the conflict and feed it to the robots to see how bad it all gets :-)

I'll let you know if/when i'll push them to -tip.

Works for me! I will keep them in the meantime, until told otherwise by tip-bot.

Thanx, Paul