[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101021.040319.191412436.davem@davemloft.net>
Date: Thu, 21 Oct 2010 04:03:19 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: timo.teras@....fi
Cc: eric.dumazet@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH] ipv4: synchronize bind() with RTM_NEWADDR notifications
From: Timo Teräs <timo.teras@....fi>
Date: Thu, 21 Oct 2010 13:58:08 +0300
> On 10/21/2010 01:50 PM, David Miller wrote:
>> From: Timo Teräs <timo.teras@....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?
RTNL interlocks globally with a heavy primitive, a mutex, lock_sock()
grabs a spinlcok which is local to the socket's context.
So if we have 100,000 sockets binding we'll suck with you're change
whereas the lock_sock() does not cause that problem.
Is this so difficult for you to comprehend?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists