net: RCU lookups for UDP, DCCP and TCP protocol
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 25 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | rcu: Introduce hlist_nulls variant of hlistinclude/ include/ | +204 | 14 replies | |
| 2/3 | udp: Use hlist_nulls in UDP RCU codeinclude/ include/ include/ +2 more | +83 | 2 replies | |
| 3/3 | net: Convert TCP & DCCP hash tables to use RCU / hlist_nullsinclude/ include/ net/ +10 more | +151 | 13 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Peter Zijlstra | Paul E. McKenney |
|---|---|---|
| 1/3 | A-b A-b | R-b |
| 2/3 | R-b | |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] net: RCU lookups for UDP, DCCP and TCP protocol
Hi all
Here is a serie of three patches (based on net-next-2.6), to continue work with RCU on UDP/TCP/DCCP stacks
Many thanks for all usefull reviews and comments, especially from Paul and Corey.
1) Introduce hlist_nulls variant of hlist
hlist uses NULL value to finish a chain.
hlist_nulls variant use the low order bit set to 1 to signal an end marker. This allows to store many different end markers, so that some RCU lockless algos (used in TCP/UDP stack for example) can save some memory barriers in fast paths.
2) Use hlist_nulls in UDP RCU code
This is a straightforward patch, using hlist_nulls infrastructure. RCU-ification already done on UDP two weeks ago, so hlist_nulls permits us to avoid some memory barriers, both at lookup time and delete time. Patch is large because it adds new macros to include/net/sock.h. These macros will be used by TCP & DCCP too.
3) Convert TCP & DCCP hash tables to use RCU & hlist_nulls
RCU was added to UDP lookups, using a fast infrastructure :
- sockets kmem_cache use SLAB_DESTROY_BY_RCU and dont pay the price of call_rcu() at freeing time.
- hlist_nulls permits to use few memory barriers.
This patch uses same infrastructure for TCP/DCCP established and timewait sockets.
Thanks to SLAB_DESTROY_BY_RCU, no slowdown for applications using short lived TCP connections. A followup patch, converting rwlocks to spinlocks will even speedup this case.
__inet_lookup_established() is pretty fast now we dont have to dirty a contended cache line (read_lock/read_unlock)
Only established and timewait hashtable are converted to RCU
(bind table and listen table are still using traditional locking)