lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 04 Dec 2009 01:28:11 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Octavian Purdila <opurdila@...acom.com>
CC:	netdev@...r.kernel.org,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [PATCH 3/4] llc: use a device based hash table to speed up multicast
 delivery

Octavian Purdila a écrit :
> On Friday 04 December 2009 01:52:44 you wrote:
>> Octavian Purdila a écrit :
> 
>>> Since at this point we are using UP ports contention is not really an
>>> issue for us. I've extrapolated this (lock per hash bucket) based on how
>>> locking is done in other places, like UDP.
>> Yes but you know we want to remove those locks per UDP hash bucket, since
>>  we dont really need them anymore. ;)
>>
>> If you remember, we had in the past one rwlock for the whole UDP table.
>>
>> Then this was converted to one spinlock per hash slot (128 slots) + RCU
>>  lookups for unicast RX
>>
>> Then we dynamically sized udp table at boot (up to 65536 slots)
>>
>> multicast optimization (holding lock for small duration + double hashing)
>>
>> bind optimization (thanks to double hashing)
>>
>> To be done :
>>
>> 1) multicast RX can be done without taking any lock, and RCU lookups
>> 2) zap all locks and use one lock, or a small array of hashed spinlocks
>>
> 
> Thanks for the nice summary Eric !
> 
> I still have one doubt related to this: we still need locking for creating and 
> destroying sockets to insert/remove them into/from the hash, RCU can't help us 
> here, right? 

Sure. RCU is used for readers only. We still need locks to protect writers
against them.

> 
> In that case wouldn't spinlock contention become an issue for short lived 
> connections? Probably not for UDP (or LLC), but for TCP I certainly can think 
> of a few usecases for short lived connections.

Yes, this is why an array of hashed spinlocks would be good, (as already done with TCP
for example, or IP route cache)

(Say you have a table of 65536 UDP slots on your high performance server,
handling millions of udp sockets, you dont _need_ 65536 spinlocks, but some number
related to number of cpus)


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ