From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: Cong Wang <cwang@twopensource.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
netdev <netdev@vger.kernel.org>,
tgraf@suug.ch
Subject: Re: [Patch net-next] fib: move fib_rules_cleanup_ops() under rtnl lock
Date: Thu, 26 Mar 2015 16:47:37 -0700 [thread overview]
Message-ID: <55149A99.6040704@redhat.com> (raw)
In-Reply-To: <CAHA+R7MKNcOOiAsV7iQ2WT=sXCmaM0FuJ0OuY_S8reP2K8hN=w@mail.gmail.com>
On 03/26/2015 04:05 PM, Cong Wang wrote:
> On Thu, Mar 26, 2015 at 3:32 PM, Cong Wang <cwang@twopensource.com> wrote:
>> On the other hand, the name rules_mod_lock already tells it is
>> just a protection for ops (module) register.
> I even doubt we really need rules_mod_lock, it is per netns,
> which is newly allocated when registering pernet and upper
> layer should guarantee no concurrent unregistering, so we
> probably only need to take rtnl lock.
I'm adding Thomas as he was the original author for the code and might
have a better idea of what needs to be rtnl locked and what doesn't.
You should probably CC him as well on the v2 patch.
As far as why I am so focused on moving fib4_rules_exit it is because we
don't want to call that delete function until after the table has been
cleared. Otherwise you end up triggering the external_flush and unmerge
code on a full table instead of an empty one. The result is you end up
allocating a bunch of memory before you then turn around and free it.
So even if you retain the rtnl_lock changes it would still be best to
move fib4_rules_exit call to the region after you have freed the FIB
tables, but before you free fib_table_hash.
- Alex
next prev parent reply other threads:[~2015-03-26 23:47 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 [this message]
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
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=55149A99.6040704@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.