public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Marco Elver <elver@google.com>
Cc: "Ahmed S. Darwish" <a.darwish@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, Will Deacon <will@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	the arch/x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	bigeasy@linutronix.de, "David S. Miller" <davem@davemloft.net>,
	sparclinux@vger.kernel.org, Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, heiko.carstens@de.ibm.com,
	linux-s390@vger.kernel.org, linux@armlinux.org.uk,
	Qian Cai <cai@lca.pw>
Subject: Re: [PATCH v4 7/8] lockdep: Change hardirq{s_enabled,_context} to per-cpu variables
Date: Tue, 23 Jun 2020 22:08:00 +0200	[thread overview]
Message-ID: <20200623200800.GD2483@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20200623191335.GA86296@elver.google.com>

On Tue, Jun 23, 2020 at 09:13:35PM +0200, Marco Elver wrote:
> [   10.182354] ------------[ cut here ]------------
> [   10.183058] WARNING: CPU: 7 PID: 136 at kernel/locking/lockdep.c:398 lockdep_hardirqs_on_prepare+0x1c6/0x270
> [   10.184347] Modules linked in:
> [   10.184771] CPU: 7 PID: 136 Comm: systemd-journal Not tainted 5.8.0-rc1+ #3
> [   10.185706] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
> [   10.186821] RIP: 0010:lockdep_hardirqs_on_prepare+0x1c6/0x270
> [   10.187594] Code: 75 28 65 48 8b 04 25 28 00 00 00 48 3b 44 24 08 0f 85 b9 00 00 00 48 83 c4 10 5b 41 5e 41 5f c3 65 48 ff 05 d4 24 4e 75 eb d8 <0f> 0b 90 41 c7 86 c4 08 00 00 00 00 00 00 eb c8 e8 65 09 71 01 85
> [   10.190203] RSP: 0018:ffffa7ee802b7848 EFLAGS: 00010017
> [   10.190989] RAX: 0000000000000001 RBX: ffff955e92a34ab0 RCX: 0000000000000001
> [   10.192053] RDX: 0000000000000006 RSI: ffff955e92a34a88 RDI: ffff955e92a341c0
> [   10.193117] RBP: ffffa7ee802b7be8 R08: 0000000000000000 R09: 0000ffffffffffff
> [   10.194186] R10: 0000ffffffffffff R11: 0000ffff8d07e268 R12: 0000000000000001
> [   10.195249] R13: ffffffff8e41bb10 R14: ffff955e92a341c0 R15: 0000000000000001
> [   10.196312] FS:  00007fd6862aa8c0(0000) GS:ffff955e9fd80000(0000) knlGS:0000000000000000
> [   10.197513] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [   10.198373] CR2: 00007fd6837dd000 CR3: 0000000812acc001 CR4: 0000000000760ee0
> [   10.199436] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   10.200494] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [   10.201554] PKRU: 55555554
> [   10.201967] Call Trace:
> [   10.202348]  ? _raw_spin_unlock_irqrestore+0x40/0x70
> [   10.203093]  trace_hardirqs_on+0x56/0x60			<----- enter IRQ flags tracing code?
> [   10.203686]  _raw_spin_unlock_irqrestore+0x40/0x70  		<----- take report_lock
> [   10.204406]  prepare_report+0x11f/0x150
> [   10.204986]  kcsan_report+0xca/0x6c0 			<----- generating a KCSAN report

Oh, duh.. that's because lockdep_off() ;-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index ab7571c1a1f5..c9ea05edce25 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -395,7 +395,7 @@ void lockdep_init_task(struct task_struct *task)
 
 static __always_inline void lockdep_recursion_finish(void)
 {
-	if (WARN_ON_ONCE(--current->lockdep_recursion))
+	if (WARN_ON_ONCE((--current->lockdep_recursion) & LOCKDEP_RECURSION_MASK))
 		current->lockdep_recursion = 0;
 }
 


  parent reply	other threads:[~2020-06-23 21:37 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23  8:36 [PATCH v4 0/8] lockdep: Change IRQ state tracking to use per-cpu variables Peter Zijlstra
2020-06-23  8:36 ` [PATCH v4 1/8] lockdep: Prepare for NMI IRQ state tracking Peter Zijlstra
2020-07-11 10:09   ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2020-06-23  8:36 ` [PATCH v4 2/8] x86/entry: Fix NMI vs " Peter Zijlstra
2020-07-11 10:09   ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2020-06-23  8:36 ` [PATCH v4 3/8] sparc64: Fix asm/percpu.h build error Peter Zijlstra
2020-06-23 21:35   ` David Miller
2020-07-11 10:09   ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2020-06-23  8:36 ` [PATCH v4 4/8] powerpc64: Break asm/percpu.h vs spinlock_types.h dependency Peter Zijlstra
2020-06-23  8:36 ` [PATCH v4 5/8] s390: Break cyclic percpu include Peter Zijlstra
2020-07-11 10:09   ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2020-06-23  8:36 ` [PATCH v4 6/8] arm: " Peter Zijlstra
2020-06-23  9:02   ` Will Deacon
2020-06-24 17:53     ` Peter Zijlstra
2020-06-25  7:31       ` Will Deacon
2020-07-11 10:09   ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2020-06-23  8:36 ` [PATCH v4 7/8] lockdep: Change hardirq{s_enabled,_context} to per-cpu variables Peter Zijlstra
2020-06-23 15:00   ` Ahmed S. Darwish
2020-06-23 15:24     ` Peter Zijlstra
2020-06-23 16:13       ` Ahmed S. Darwish
2020-06-23 16:37         ` Peter Zijlstra
2020-06-23 17:59           ` Marco Elver
2020-06-23 18:12             ` Peter Zijlstra
2020-06-23 18:39               ` Marco Elver
2020-06-23 19:13                 ` Marco Elver
2020-06-23 19:41                   ` Peter Zijlstra
2020-06-23 20:08                   ` Peter Zijlstra [this message]
2020-06-23 20:24               ` Peter Zijlstra
2020-06-23 20:33                 ` Peter Zijlstra
2020-06-24  9:00                 ` Peter Zijlstra
2020-06-24 10:17                   ` Marco Elver
2020-06-24 12:31                     ` Peter Zijlstra
2020-06-24 11:32                 ` Marco Elver
2020-06-24 15:18                   ` Peter Zijlstra
2020-07-11 10:09                   ` [tip: locking/core] kcsan: Make KCSAN compatible with new IRQ state tracking tip-bot2 for Marco Elver
2020-06-30  5:59   ` [PATCH v4 7/8] lockdep: Change hardirq{s_enabled,_context} to per-cpu variables Ahmed S. Darwish
2020-06-30  9:40     ` Peter Zijlstra
2020-07-11 10:09   ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2020-06-23  8:36 ` [PATCH v4 8/8] lockdep: Remove lockdep_hardirq{s_enabled,_context}() argument Peter Zijlstra
2020-07-11 10:09   ` [tip: locking/core] " tip-bot2 for Peter Zijlstra

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=20200623200800.GD2483@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=a.darwish@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=cai@lca.pw \
    --cc=davem@davemloft.net \
    --cc=elver@google.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=rostedt@goodmis.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.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