linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] locking/lockdep: use pr_warn_once for reporting that lockdep is turned off
@ 2022-07-20 13:01 Tetsuo Handa
  2022-07-20 14:59 ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Tetsuo Handa @ 2022-07-20 13:01 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon; +Cc: linux-kernel

debug_show_all_locks() can be called for multiple times if
hung_task_call_panic = 0. No need to repeat this message.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 kernel/locking/lockdep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 64a13eb56078..27be3c83c753 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -6490,7 +6490,7 @@ void debug_show_all_locks(void)
 	struct task_struct *g, *p;
 
 	if (unlikely(!debug_locks)) {
-		pr_warn("INFO: lockdep is turned off.\n");
+		pr_warn_once("INFO: lockdep is turned off.\n");
 		return;
 	}
 	pr_warn("\nShowing all locks held in the system:\n");
@@ -6518,7 +6518,7 @@ EXPORT_SYMBOL_GPL(debug_show_all_locks);
 void debug_show_held_locks(struct task_struct *task)
 {
 	if (unlikely(!debug_locks)) {
-		printk("INFO: lockdep is turned off.\n");
+		pr_warn_once("INFO: lockdep is turned off.\n");
 		return;
 	}
 	lockdep_print_held_locks(task);
-- 
2.18.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] locking/lockdep: use pr_warn_once for reporting that lockdep is turned off
  2022-07-20 13:01 [PATCH] locking/lockdep: use pr_warn_once for reporting that lockdep is turned off Tetsuo Handa
@ 2022-07-20 14:59 ` Peter Zijlstra
  2022-07-20 15:13   ` Tetsuo Handa
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2022-07-20 14:59 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: Ingo Molnar, Will Deacon, linux-kernel

On Wed, Jul 20, 2022 at 10:01:36PM +0900, Tetsuo Handa wrote:
> debug_show_all_locks() can be called for multiple times if
> hung_task_call_panic = 0. No need to repeat this message.

That one extra line is really a problem?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] locking/lockdep: use pr_warn_once for reporting that lockdep is turned off
  2022-07-20 14:59 ` Peter Zijlstra
@ 2022-07-20 15:13   ` Tetsuo Handa
  2022-07-20 15:37     ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Tetsuo Handa @ 2022-07-20 15:13 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Ingo Molnar, Will Deacon, linux-kernel

On 2022/07/20 23:59, Peter Zijlstra wrote:
> On Wed, Jul 20, 2022 at 10:01:36PM +0900, Tetsuo Handa wrote:
>> debug_show_all_locks() can be called for multiple times if
>> hung_task_call_panic = 0. No need to repeat this message.
> 
> That one extra line is really a problem?

When lockdep is turned off during boot or some testing, khungtaskd repeats
this message, and I feel this repeated message useless.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] locking/lockdep: use pr_warn_once for reporting that lockdep is turned off
  2022-07-20 15:13   ` Tetsuo Handa
@ 2022-07-20 15:37     ` Peter Zijlstra
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2022-07-20 15:37 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: Ingo Molnar, Will Deacon, linux-kernel

On Thu, Jul 21, 2022 at 12:13:31AM +0900, Tetsuo Handa wrote:
> On 2022/07/20 23:59, Peter Zijlstra wrote:
> > On Wed, Jul 20, 2022 at 10:01:36PM +0900, Tetsuo Handa wrote:
> >> debug_show_all_locks() can be called for multiple times if
> >> hung_task_call_panic = 0. No need to repeat this message.
> > 
> > That one extra line is really a problem?
> 
> When lockdep is turned off during boot or some testing, khungtaskd repeats
> this message, and I feel this repeated message useless.

I feel you should then fix the issue that lockdep is complaining about
instead of making the message go away.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-20 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20 13:01 [PATCH] locking/lockdep: use pr_warn_once for reporting that lockdep is turned off Tetsuo Handa
2022-07-20 14:59 ` Peter Zijlstra
2022-07-20 15:13   ` Tetsuo Handa
2022-07-20 15:37     ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).