From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: Cong Wang <cwang@twopensource.com>
Cc: Thomas Graf <tgraf@suug.ch>, Cong Wang <xiyou.wangcong@gmail.com>,
netdev <netdev@vger.kernel.org>
Subject: Re: [Patch net-next] fib: move fib_rules_cleanup_ops() under rtnl lock
Date: Tue, 31 Mar 2015 10:30:48 -0700 [thread overview]
Message-ID: <551AD9C8.4090809@redhat.com> (raw)
In-Reply-To: <CAHA+R7Pg6K2horjg1wCCxyVqAcb0L7T3v=mnDnpb2Vqa-8VEfg@mail.gmail.com>
On 03/31/2015 09:47 AM, Cong Wang wrote:
> On Mon, Mar 30, 2015 at 8:10 PM, Alexander Duyck
> <alexander.h.duyck@redhat.com> wrote:
>> On 03/30/2015 05:12 PM, Cong Wang wrote:
>>> 2) remove the unnecessary rules_mod_lock
>>>
>>> Thanks.
>>
>> Please define "unnecessary" as we have had a bit of back and forth on how
>> our views can differ there. As far as I know it still has to be held for
>> the fib_rule_ops list manipulation, specifically the call to list_del_rcu.
>> However, it doesn't need to be held when we call fib_rules_cleanup_ops.
>>
> Look at where rules_mod_lock are held: either when the net is initialized
> or when unregistering, neither of them really needs this per netns lock:
> new netns is not ready to expose;
> concurrent unregistering is prevented by upper layer locking,
> readers (lookup_rules_ops) hold RCU but we already should hold rtnl lock
> (after patch of course).
I would have almost agreed with you, however I noticed that decnet
doesn't seem to follow the same rules as the rest of the callers to
fib_rules_register. It will simply call into module_init -> decnet_init
-> dn_fib_init -> dn_fib_rules_injt -> fib_rules_register(&init_net).
It probably just needs to be rewritten to use
register_pernet_subsys/unregister_pernet_subsys, or correctly use the
net_mutex, and then you could probably go head and tear out the
rules_mod_lock since they would all be covered under the net_mutex.
- Alex
next prev parent reply other threads:[~2015-03-31 17:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 21:02 [Patch net-next] fib: move fib_rules_cleanup_ops() under rtnl lock Cong Wang
2015-03-26 21:47 ` Alexander Duyck
2015-03-26 21:55 ` Cong Wang
2015-03-26 22:17 ` Alexander Duyck
2015-03-26 22:32 ` Cong Wang
2015-03-26 23:05 ` Cong Wang
2015-03-26 23:47 ` Alexander Duyck
2015-03-27 12:01 ` Thomas Graf
2015-03-27 19:25 ` Cong Wang
2015-03-27 21:08 ` Alexander Duyck
2015-03-27 21:17 ` Cong Wang
2015-03-27 22:12 ` Alexander Duyck
2015-03-30 23:47 ` Cong Wang
2015-03-31 0:02 ` Alexander Duyck
2015-03-31 0:12 ` Cong Wang
2015-03-31 3:10 ` Alexander Duyck
2015-03-31 16:47 ` Cong Wang
2015-03-31 17:30 ` Alexander Duyck [this message]
2015-03-31 17:56 ` Cong Wang
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=551AD9C8.4090809@redhat.com \
--to=alexander.h.duyck@redhat.com \
--cc=cwang@twopensource.com \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
--cc=xiyou.wangcong@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.