From: Miles Lane <miles.lane@gmail.com>
To: paulmck@linux.vnet.ibm.com
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Vivek Goyal <vgoyal@redhat.com>, Eric Paris <eparis@redhat.com>,
Lai Jiangshan <laijs@cn.fujitsu.com>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
nauman@google.com, eric.dumazet@gmail.com,
netdev@vger.kernel.org, Jens Axboe <jens.axboe@oracle.com>,
Gui Jianfeng <guijianfeng@cn.fujitsu.com>,
Li Zefan <lizf@cn.fujitsu.com>,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage
Date: Tue, 27 Apr 2010 13:58:30 -0400 [thread overview]
Message-ID: <g2ya44ae5cd1004271058p9f73fba1v3f611693e81869c3@mail.gmail.com> (raw)
In-Reply-To: <20100427162201.GA5826@linux.vnet.ibm.com>
On Tue, Apr 27, 2010 at 12:22 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
> On Mon, Apr 26, 2010 at 09:27:44PM -0700, Paul E. McKenney wrote:
>> On Mon, Apr 26, 2010 at 11:35:10AM -0700, Eric W. Biederman wrote:
>> > "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> writes:
>> >
>> > > Eric Dumazet traced these down to a commit from Eric Biederman.
>> > >
>> > > If I don't hear from Eric Biederman in a few days, I will attempt a
>> > > patch, but it would be more likely to be correct coming from someone
>> > > with a better understanding of the code. ;-)
>> >
>> > I already replied.
>> >
>> > http://lkml.org/lkml/2010/4/21/420
>>
>> You did indeed!!! This experience is giving me an even better appreciation
>> of the maintainers' ability to keep all their patches straight!
>>
>> I will put together something based on your suggestion.
>
> How about the following?
>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit 85fa42bd568ab99c375f018761ae6345249942cd
> Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Date: Mon Apr 26 21:40:05 2010 -0700
>
> net: suppress RCU lockdep false positive in twsk_net()
>
> Calls to twsk_net() are in some cases protected by reference counting
> as an alternative to RCU protection. Cases covered by reference counts
> include __inet_twsk_kill(), inet_twsk_free(), inet_twdr_do_twkill_work(),
> inet_twdr_twcal_tick(), and tcp_timewait_state_process(). RCU is used
> by inet_twsk_purge(). Locking is used by established_get_first()
> and established_get_next(). Finally, __inet_twsk_hashdance() is an
> initialization case.
>
> It appears to be non-trivial to locate the appropriate locks and
> reference counts from within twsk_net(), so used rcu_dereference_raw().
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
> index 79f67ea..a066fdd 100644
> --- a/include/net/inet_timewait_sock.h
> +++ b/include/net/inet_timewait_sock.h
> @@ -224,7 +224,9 @@ static inline
> struct net *twsk_net(const struct inet_timewait_sock *twsk)
> {
> #ifdef CONFIG_NET_NS
> - return rcu_dereference(twsk->tw_net);
> + return rcu_dereference_raw(twsk->tw_net); /* protected by locking, */
> + /* reference counting, */
> + /* initialization, or RCU. */
> #else
> return &init_net;
> #endif
>
Worked for me. Thanks!
Miles
next prev parent reply other threads:[~2010-04-27 17:58 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1271242058.32749.19.camel@laptop>
[not found] ` <1271701612.2972.5.camel@dhcp231-113.rdu.redhat.com>
[not found] ` <20100419230136.GA16856@linux.vnet.ibm.com>
[not found] ` <1271726729.2972.13.camel@dhcp231-113.rdu.redhat.com>
[not found] ` <20100420030452.GB2905@linux.vnet.ibm.com>
[not found] ` <4BCD646B.1080206@cn.fujitsu.com>
[not found] ` <1271766716.2972.16.camel@dhcp231-113.rdu.redhat.com>
[not found] ` <j2ya44ae5cd1004200545q6be4ec82o18ae99d93e8c29c7@mail.gmail.com>
[not found] ` <20100420135227.GC2628@linux.vnet.ibm.com>
[not found] ` <t2la44ae5cd1004200838w87256e80v9dcde91342b321db@mail.gmail.com>
2010-04-21 21:35 ` [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage Paul E. McKenney
2010-04-21 21:48 ` Paul E. McKenney
2010-04-21 21:57 ` Eric Dumazet
2010-04-21 22:14 ` Paul E. McKenney
2010-04-21 23:26 ` Eric W. Biederman
2010-04-22 14:56 ` Vivek Goyal
2010-04-22 16:01 ` Paul E. McKenney
2010-04-23 12:50 ` Miles Lane
2010-04-23 19:42 ` Paul E. McKenney
2010-04-23 22:59 ` Miles Lane
2010-04-24 5:35 ` Miles Lane
2010-04-25 2:36 ` Paul E. McKenney
2010-04-25 2:34 ` Paul E. McKenney
2010-04-25 7:45 ` Johannes Berg
2010-04-25 7:49 ` David Miller
2010-04-26 2:07 ` Paul E. McKenney
2010-04-25 15:49 ` Miles Lane
2010-04-25 20:20 ` Miles Lane
2010-04-26 16:09 ` Paul E. McKenney
2010-04-26 18:35 ` Eric W. Biederman
2010-04-27 4:27 ` Paul E. McKenney
2010-04-27 16:22 ` Paul E. McKenney
2010-04-27 16:33 ` Eric Dumazet
2010-04-27 17:58 ` Miles Lane [this message]
2010-04-27 23:31 ` Paul E. McKenney
2010-04-27 23:42 ` David Miller
2010-04-27 23:52 ` Paul E. McKenney
[not found] ` <p2ka44ae5cd1004281358n86ce29d2tbece16b2fb974dab@mail.gmail.com>
2010-04-28 21:37 ` Paul E. McKenney
[not found] ` <20100421060428.GA3839@liondog.tnic>
2010-04-21 21:45 ` Paul E. McKenney
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=g2ya44ae5cd1004271058p9f73fba1v3f611693e81869c3@mail.gmail.com \
--to=miles.lane@gmail.com \
--cc=ebiederm@xmission.com \
--cc=eparis@redhat.com \
--cc=eric.dumazet@gmail.com \
--cc=guijianfeng@cn.fujitsu.com \
--cc=jens.axboe@oracle.com \
--cc=johannes@sipsolutions.net \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=nauman@google.com \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=vgoyal@redhat.com \
/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).