From: Eric Dumazet <eric.dumazet@gmail.com>
To: Nicolas Schichan <nschichan@freebox.fr>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Cong Wang <amwang@redhat.com>
Subject: Re: freeze with interface rename & SIOCGIFNAME
Date: Tue, 25 Jun 2013 09:57:27 -0700 [thread overview]
Message-ID: <1372179447.3301.105.camel@edumazet-glaptop> (raw)
In-Reply-To: <51C9C4FF.1020706@freebox.fr>
On Tue, 2013-06-25 at 18:27 +0200, Nicolas Schichan wrote:
> On 06/25/2013 06:15 PM, Eric Dumazet wrote:
> > Nice catch !
> >
> > Please add a helper so that we can use it as well from
> > sock_getbindtodevice(), and submit an official patch ?
>
> Sure, I'll do that.
>
> > int netdev_get_name(char *name, int ifindex)
> > {
> > struct net_device *dev;
> > unsigned int seq;
> >
> > retry:
> > seq = read_seqcount_begin(&devnet_rename_seq);
>
> raw_seqcount_begin is required here here. read_seqcount_begin will spin
> forever as the s->sequence & 1 check will always be true in
> __read_seqcount_begin(). This will incur some unneed work if a rename is in
> progress, but that's better than locking the system up.
I am not sure it's needed, because the writer holds a spinlock and is
not allowed to sleep or being preempted.
If it's needed, there is a bug somewhere else...
next prev parent reply other threads:[~2013-06-25 16:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <51C9BB9C.4050405@freebox.fr>
2013-06-25 16:15 ` freeze with interface rename & SIOCGIFNAME Eric Dumazet
2013-06-25 16:27 ` Nicolas Schichan
2013-06-25 16:57 ` Eric Dumazet [this message]
2013-06-25 17:05 ` Eric Dumazet
2013-06-25 17:12 ` Nicolas Schichan
2013-06-25 17:19 ` Eric Dumazet
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=1372179447.3301.105.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nschichan@freebox.fr \
/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