From: Peter Zijlstra <peterz@infradead.org>
To: David Miller <davem@davemloft.net>
Cc: rostedt@goodmis.org, eric.dumazet@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kaber@trash.net, mingo@elte.hu
Subject: Re: [LOCKDEP BUG][2.6.36-rc1] xt_info_wrlock?
Date: Mon, 16 Aug 2010 22:04:56 +0200 [thread overview]
Message-ID: <1281989096.1926.1952.camel@laptop> (raw)
In-Reply-To: <20100816.124400.42792595.davem@davemloft.net>
On Mon, 2010-08-16 at 12:44 -0700, David Miller wrote:
> He's only accessing the per-cpu counter locks of other cpus.
>
> The per-cpu lock is only locally accessed by a cpu in software
> interrupt context.
>
> That is why his transformation is legal.
>
> Lockdep simply hasn't been informed of this invariant and has
> to assume the worst.
Something like the below will keep lockdep coverage, still going back to
RCU sounds like the best option.
---
include/linux/netfilter/x_tables.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 24e5d01..a195feb 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -511,12 +511,21 @@ static inline void xt_info_rdunlock_bh(void)
*/
static inline void xt_info_wrlock(unsigned int cpu)
{
+#ifdef CONFIG_PROVE_LOCKING
+ /*
+ * XXX foo
+ */
+ local_bh_disable();
+#endif
spin_lock(&per_cpu(xt_info_locks, cpu).lock);
}
static inline void xt_info_wrunlock(unsigned int cpu)
{
spin_unlock(&per_cpu(xt_info_locks, cpu).lock);
+#ifdef CONFIG_PROVE_LOCKING
+ local_bh_enable();
+#endif
}
/*
prev parent reply other threads:[~2010-08-16 20:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 17:07 [LOCKDEP BUG][2.6.36-rc1] xt_info_wrlock? Steven Rostedt
2010-08-16 17:31 ` Eric Dumazet
2010-08-16 17:55 ` Steven Rostedt
2010-08-16 18:16 ` Steven Rostedt
2010-08-16 18:36 ` Peter Zijlstra
2010-08-16 18:48 ` Eric Dumazet
2010-08-16 19:16 ` Peter Zijlstra
2010-08-16 19:35 ` Eric Dumazet
2010-08-16 20:01 ` Peter Zijlstra
2010-08-16 20:17 ` Eric Dumazet
2010-08-16 18:48 ` Eric Dumazet
2010-08-16 19:44 ` David Miller
2010-08-16 20:04 ` Peter Zijlstra [this message]
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=1281989096.1926.1952.camel@laptop \
--to=peterz@infradead.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).