From: ebiederm@xmission.com (Eric W. Biederman)
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, hadi@cyberus.ca, dlezcano@fr.ibm.com,
adobriyan@gmail.com, kaber@trash.net, opurdila@ixiacom.com
Subject: Re: [PATCH 01/20] net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH
Date: Mon, 30 Nov 2009 15:42:13 -0800 [thread overview]
Message-ID: <m1d42zoa0a.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20091130.144917.233710214.davem@davemloft.net> (David Miller's message of "Mon\, 30 Nov 2009 14\:49\:17 -0800 \(PST\)")
David Miller <davem@davemloft.net> writes:
> From: "Eric W. Biederman" <ebiederm@xmission.com>
> Date: Sun, 29 Nov 2009 17:45:58 -0800
>
>> Additionally it appears that we moved the route cache flush after
>> the final synchronize_net, which seems wrong and there was no
>> explanation. So I have restored the original location of the final
>> synchronize_net.
>
> I think the idea was that it's important for all pending stale
> RCU references to the device to be gone before we send out the
> notifier. And that's why the synchronize_net() comes first.
>
> This needs more thought.
The only case the affects (today) is the invalidation of the route/flow cache.
The routing table until the addition of NETDEV_UNREGISTER_PERNET happened
in the notifier NETDEV_UNREGISTER, which comes before the final synchronize_net.
The routing cache has rcu references to the network device.
So it appears to me that with the current pernet batched routing code cleanup we
can end up calling kfree before all of the call_rcu functions triggered by
rt_do_flush will be run.
netdev_run_todo()
kobject_put()
netdev_release()
kfree()
NETDEV_UNREGISTER_PERCPU
rt_cache_flush(xxx, 0)
rt_do_flush()
rt_free
call_rcu
So it appears to me that moving the final syncrhonize_net() back where it was before
the NETDEV_UNREGISTER_PERNET changes (as I did) is necessary for correctness.
Eric
next prev parent reply other threads:[~2009-11-30 23:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-30 1:45 [PATCH 01/20] net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH Eric W. Biederman
2009-11-30 1:46 ` [PATCH 07/20] net: Simplify the bond drivers pernet operations Eric W. Biederman
2009-11-30 1:46 ` [PATCH 08/20] net: Simplify vlan " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 09/20] net: Simplify af_key " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 10/20] net: Simplify conntrack_proto_dccp " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 11/20] net: Simplify conntrack_proto_gre " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 12/20] net: Simplify ppp_generic " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 13/20] net: Simplify pppoe " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 14/20] net: Simplify pppol2tp " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 15/20] net: Simplify phonet " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 16/20] net: Simplify ip_gre " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 17/20] net: Simplify ipip " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 18/20] net: Simplify ip6_tunnel " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 19/20] net: Simplify ipip6 aka sit " Eric W. Biederman
2009-11-30 1:46 ` [PATCH 20/20] net: remove [un]register_pernet_gen_... and update the docs Eric W. Biederman
2009-11-30 12:08 ` [PATCH 01/20] net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH Octavian Purdila
2009-11-30 19:00 ` Eric W. Biederman
2009-11-30 19:25 ` Octavian Purdila
2009-11-30 22:49 ` David Miller
2009-11-30 23:42 ` Eric W. Biederman [this message]
2009-11-30 23:55 ` David Miller
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=m1d42zoa0a.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=adobriyan@gmail.com \
--cc=davem@davemloft.net \
--cc=dlezcano@fr.ibm.com \
--cc=hadi@cyberus.ca \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=opurdila@ixiacom.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).