From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Timo Teräs" <timo.teras@iki.fi>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: synchronize bind() with RTM_NEWADDR notifications
Date: Thu, 21 Oct 2010 13:12:57 +0200 [thread overview]
Message-ID: <1287659577.6871.69.camel@edumazet-laptop> (raw)
In-Reply-To: <4CC01CC0.7090101@iki.fi>
Le jeudi 21 octobre 2010 à 13:58 +0300, Timo Teräs a écrit :
> On 10/21/2010 01:50 PM, David Miller wrote:
> > From: Timo Teräs <timo.teras@iki.fi>
> > Date: Thu, 21 Oct 2010 13:41:37 +0300
> >
> >> Is inet_bind() called from non-userland context? If yes, then this is a
> >> bad idea. Otherwise I don't think it's that hot path...
> >
> > It is.
>
> Yet, almost immediately after that there is lock_sock() which can also
> sleep. How does that work then?
>
I am not sure I understand your question. Maybe my answer wont be clear.
rtnl_lock() can take ages on some setups, because its using one single
and shared mutex. Its use should be restricted to administrative
purposes.
bind() is a pretty hot path on many workloads, this is hardly what we
call an administrative task.
lock_sock() uses a per socket lock, and it is a _bit_ more scalable, you
can have 4096 cpus all using bind()/recv()/send()/... at the same time,
it just works.
prev parent reply other threads:[~2010-10-21 11:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-21 10:12 [PATCH] ipv4: synchronize bind() with RTM_NEWADDR notifications Timo Teräs
2010-10-21 10:25 ` Eric Dumazet
2010-10-21 10:41 ` Timo Teräs
2010-10-21 10:50 ` David Miller
2010-10-21 10:58 ` Timo Teräs
2010-10-21 11:03 ` David Miller
2010-10-21 11:29 ` Timo Teräs
2010-10-21 11:34 ` David Miller
2010-10-21 11:57 ` Timo Teräs
2010-10-21 13:06 ` [PATCH v2] " Timo Teräs
2010-10-21 14:10 ` Eric Dumazet
2010-10-21 19:01 ` Timo Teräs
2010-10-21 11:12 ` Eric Dumazet [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=1287659577.6871.69.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=timo.teras@iki.fi \
/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