From: Florian Westphal <fw@strlen.de>
To: David Miller <davem@davemloft.net>
Cc: fw@strlen.de, netdev@vger.kernel.org, edumazet@google.com
Subject: Re: [PATCH net-next] net: core: decouple ifalias get/set from rtnl lock
Date: Mon, 2 Oct 2017 11:22:57 +0200 [thread overview]
Message-ID: <20171002092257.GA30423@breakpoint.cc> (raw)
In-Reply-To: <20171001.224644.903150013683866978.davem@davemloft.net>
David Miller <davem@davemloft.net> wrote:
> From: Florian Westphal <fw@strlen.de>
> Date: Fri, 29 Sep 2017 13:21:50 +0200
>
> > @@ -1488,7 +1484,7 @@ static void netdev_release(struct device *d)
> >
> > BUG_ON(dev->reg_state != NETREG_RELEASED);
> >
> > - kfree(dev->ifalias);
> > + kfree(rcu_access_pointer(dev->ifalias));
> > netdev_freemem(dev);
> > }
> >
>
> "kfree_rcu()" at least?
>
> If the deal is that you don't need to do and RCU free because
> netdevice objects disappear synchronously, and you can therefore prove
> that no RCU based async access can occur to dev->ifalias, then you
> need to add a comment here.
Ok, I will add a comment.
netdev_release gets called via kobject_put() if this was last reference
to the device. At that point the device has already been removed from
all lists (and private destructor was invoked too).
Also, netdev_freemem frees the net_device memory immediately
so no other cpu is allowed to use dev at this point.
prev parent reply other threads:[~2017-10-02 9:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 11:21 [PATCH net-next] net: core: decouple ifalias get/set from rtnl lock Florian Westphal
2017-10-02 5:46 ` David Miller
2017-10-02 9:22 ` Florian Westphal [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=20171002092257.GA30423@breakpoint.cc \
--to=fw@strlen.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.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).