[RFC,1/2] smp: Reduce logging due to dump_stack of CSD waiters.

Message ID 20230428170006.1241472-2-imran.f.khan@oracle.com
State New
Headers
Series smp: Reduce logging due to dump_stack of CSD waiters |

Commit Message

Imran Khan April 28, 2023, 5 p.m. UTC
  If a waiter is waiting for CSD lock, its call stack will not change
between first and subsequent hang detection for the same CSD lock.
So dump_stack for the waiter only for first time detection.

This avoids excessive logging on large scale systems(with hundreds
of CPUs) where repetitive dump_stack from hundreds of CPUs can flood
the console.

Signed-off-by: Imran Khan <imran.f.khan@oracle.com>
---
 kernel/smp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Paul E. McKenney April 28, 2023, 5:57 p.m. UTC | #1
On Sat, Apr 29, 2023 at 03:00:05AM +1000, Imran Khan wrote:
> If a waiter is waiting for CSD lock, its call stack will not change
> between first and subsequent hang detection for the same CSD lock.
> So dump_stack for the waiter only for first time detection.
> 
> This avoids excessive logging on large scale systems(with hundreds
> of CPUs) where repetitive dump_stack from hundreds of CPUs can flood
> the console.
> 
> Signed-off-by: Imran Khan <imran.f.khan@oracle.com>

Reviewed-by: Paul E. McKenney <paulmck@kernel.org>

> ---
>  kernel/smp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/smp.c b/kernel/smp.c
> index ab3e5dad6cfe9..b7ccba677a0a0 100644
> --- a/kernel/smp.c
> +++ b/kernel/smp.c
> @@ -248,7 +248,8 @@ static bool csd_lock_wait_toolong(struct __call_single_data *csd, u64 ts0, u64 *
>  			arch_send_call_function_single_ipi(cpu);
>  		}
>  	}
> -	dump_stack();
> +	if (firsttime)
> +		dump_stack();
>  	*ts1 = ts2;
>  
>  	return false;
> -- 
> 2.34.1
>
  

Patch

diff --git a/kernel/smp.c b/kernel/smp.c
index ab3e5dad6cfe9..b7ccba677a0a0 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -248,7 +248,8 @@  static bool csd_lock_wait_toolong(struct __call_single_data *csd, u64 ts0, u64 *
 			arch_send_call_function_single_ipi(cpu);
 		}
 	}
-	dump_stack();
+	if (firsttime)
+		dump_stack();
 	*ts1 = ts2;
 
 	return false;