mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] lockdep: Do not record irq state in debug_check_no_locks_freed()
@ 2018-04-04 16:19 Steven Rostedt
  2018-04-04 16:23 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2018-04-04 16:19 UTC (permalink / raw)
  To: LKML; +Cc: Peter Zijlstra, Ingo Molnar

From: Steven Rostedt (VMware) <rostedt@goodmis.org>

While debugging where things were going wrong with mapping
enabling/disabling interrupts with the lockdep state and actual real
enabling and disabling interrupts, I had to silent the irq
disabling/enabling in debug_check_no_locks_freed() because it was
always showing up as it was called before the splat was.

Use raw_local_irq_save/restore() for debug_check_no_locks_freed() as it
hides useful information about where interrupts were used incorrectly
last.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 89b5f83f1969..8c145dc1315b 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4407,7 +4407,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
 	if (unlikely(!debug_locks))
 		return;
 
-	local_irq_save(flags);
+	raw_local_irq_save(flags);
 	for (i = 0; i < curr->lockdep_depth; i++) {
 		hlock = curr->held_locks + i;
 
@@ -4418,7 +4418,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
 		print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock);
 		break;
 	}
-	local_irq_restore(flags);
+	raw_local_irq_restore(flags);
 }
 EXPORT_SYMBOL_GPL(debug_check_no_locks_freed);
 

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

* Re: [PATCH] lockdep: Do not record irq state in debug_check_no_locks_freed()
  2018-04-04 16:19 [PATCH] lockdep: Do not record irq state in debug_check_no_locks_freed() Steven Rostedt
@ 2018-04-04 16:23 ` Peter Zijlstra
  2018-04-04 17:15   ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2018-04-04 16:23 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Ingo Molnar

On Wed, Apr 04, 2018 at 12:19:04PM -0400, Steven Rostedt wrote:
> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 
> While debugging where things were going wrong with mapping
> enabling/disabling interrupts with the lockdep state and actual real
> enabling and disabling interrupts, I had to silent the irq
> disabling/enabling in debug_check_no_locks_freed() because it was
> always showing up as it was called before the splat was.
> 
> Use raw_local_irq_save/restore() for debug_check_no_locks_freed() as it
> hides useful information about where interrupts were used incorrectly
> last.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index 89b5f83f1969..8c145dc1315b 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -4407,7 +4407,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
>  	if (unlikely(!debug_locks))
>  		return;
>  
> -	local_irq_save(flags);
> +	raw_local_irq_save(flags);
>  	for (i = 0; i < curr->lockdep_depth; i++) {
>  		hlock = curr->held_locks + i;
>  
> @@ -4418,7 +4418,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
>  		print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock);
>  		break;
>  	}
> -	local_irq_restore(flags);
> +	raw_local_irq_restore(flags);
>  }
>  EXPORT_SYMBOL_GPL(debug_check_no_locks_freed);

Makes sense, could you convert all of them just to make sure there
aren't any left?

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

* Re: [PATCH] lockdep: Do not record irq state in debug_check_no_locks_freed()
  2018-04-04 16:23 ` Peter Zijlstra
@ 2018-04-04 17:15   ` Steven Rostedt
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2018-04-04 17:15 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: LKML, Ingo Molnar

On Wed, 4 Apr 2018 18:23:05 +0200
Peter Zijlstra <peterz@infradead.org> wrote:
> 
> Makes sense, could you convert all of them just to make sure there
> aren't any left?

There's a few others. I'll send another patch.

-- Steve

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

end of thread, other threads:[~2018-04-04 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-04 16:19 [PATCH] lockdep: Do not record irq state in debug_check_no_locks_freed() Steven Rostedt
2018-04-04 16:23 ` Peter Zijlstra
2018-04-04 17:15   ` Steven Rostedt

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®