Re: [PATCH 3/3] Convert the UDP hash lock to RCU

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Tuesday, October 7, 2008 - 5:59 am

Benny Amorsen a écrit :

I should have say 'Many' instead of 'Most' :)


Yes very true, but current allocation of a random port can be very expensive, 
since we scan all the UDP hash table to select the smaller hash chain.

We stop the scan if we find an empty slot, but on machines with say more than 200
bound UDP sockets, they are probably no empty slots. (UDP_HTABLE_SIZE is 128)

bind(NULL port) algo is then O(N), N being number of bound UDP sockets.

So heavy DNS servers/proxies probably use a pool/range of pre-allocated sockets
to avoid costs of allocating/freeing them ? If they dont care about that cost,
the extra call_rcu() will be unnoticed.

For pathological (yet very common :) ) cases like single DNS query/answer, RCU
would mean :

Pros :
- one few rwlock hit when receiving the answer (if any)
Cons :
- one call_rcu() to delay socket freeing/reuse after RCU period.

So it might be a litle bit more expensive than without RCU

I agree I am more interested in optimizing UDP stack for heavy users like RTP 
servers/proxies handling xxx.000 packets/second than DNS users/servers.
Shame on me :)

(2 weeks ago, Corey mentioned a 10x increase on UDP throughput on a 16-way machine,
that sounds promising)





--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/3] Convert the UDP hash lock to RCU, Corey Minyard, (Mon Oct 6, 11:50 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Eric Dumazet, (Mon Oct 6, 2:22 pm)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, David Miller, (Mon Oct 6, 2:40 pm)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Corey Minyard, (Mon Oct 6, 3:07 pm)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Corey Minyard, (Mon Oct 6, 4:08 pm)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Eric Dumazet, (Mon Oct 6, 10:24 pm)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Peter Zijlstra, (Tue Oct 7, 1:17 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Peter Zijlstra, (Tue Oct 7, 1:31 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Evgeniy Polyakov, (Tue Oct 7, 1:37 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Benny Amorsen, (Tue Oct 7, 1:54 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Eric Dumazet, (Tue Oct 7, 2:24 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Eric Dumazet, (Tue Oct 7, 5:59 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Stephen Hemminger, (Tue Oct 7, 7:07 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Christoph Lameter, (Tue Oct 7, 7:15 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Christoph Lameter, (Tue Oct 7, 7:16 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Evgeniy Polyakov, (Tue Oct 7, 7:29 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Paul E. McKenney, (Tue Oct 7, 7:33 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Paul E. McKenney, (Tue Oct 7, 7:36 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Paul E. McKenney, (Tue Oct 7, 7:38 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Christoph Lameter, (Tue Oct 7, 7:38 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Christoph Lameter, (Tue Oct 7, 7:45 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Eric Dumazet, (Tue Oct 7, 7:50 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Paul E. McKenney, (Tue Oct 7, 8:05 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Eric Dumazet, (Tue Oct 7, 8:07 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Paul E. McKenney, (Tue Oct 7, 8:07 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Peter Zijlstra, (Tue Oct 7, 8:09 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Christoph Lameter, (Tue Oct 7, 8:23 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Corey Minyard, (Tue Oct 7, 9:43 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, David Miller, (Tue Oct 7, 11:26 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, David Miller, (Tue Oct 7, 11:29 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, David Miller, (Tue Oct 7, 1:55 pm)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Stephen Hemminger, (Tue Oct 7, 2:20 pm)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Eric Dumazet, (Wed Oct 8, 1:35 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, Eric Dumazet, (Wed Oct 8, 6:55 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, David Miller, (Wed Oct 8, 9:38 am)
Re: [PATCH 3/3] Convert the UDP hash lock to RCU, David Miller, (Wed Oct 8, 11:45 am)
[PATCH 0/2] udp: Convert the UDP hash lock to RCU, Eric Dumazet, (Tue Oct 28, 1:37 pm)
[PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Tue Oct 28, 1:42 pm)
Re: [PATCH 0/2] udp: Convert the UDP hash lock to RCU, Stephen Hemminger, (Tue Oct 28, 2:28 pm)
Re: [PATCH 0/2] udp: Convert the UDP hash lock to RCU, Eric Dumazet, (Tue Oct 28, 2:50 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Tue Oct 28, 3:45 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Tue Oct 28, 10:05 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 1:23 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Wed Oct 29, 1:56 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 2:04 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Wed Oct 29, 2:17 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 3:19 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Corey Minyard, (Wed Oct 29, 6:17 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 7:36 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Corey Minyard, (Wed Oct 29, 8:34 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 9:09 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Paul E. McKenney, (Wed Oct 29, 9:37 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Corey Minyard, (Wed Oct 29, 10:22 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 10:32 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 10:45 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Paul E. McKenney, (Wed Oct 29, 11:11 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Wed Oct 29, 11:19 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Wed Oct 29, 11:20 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Corey Minyard, (Wed Oct 29, 11:28 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Wed Oct 29, 11:29 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 11:36 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Paul E. McKenney, (Wed Oct 29, 11:38 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Paul E. McKenney, (Wed Oct 29, 11:52 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 1:00 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Paul E. McKenney, (Wed Oct 29, 1:17 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Corey Minyard, (Wed Oct 29, 2:29 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 2:57 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Paul E. McKenney, (Wed Oct 29, 2:58 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 3:08 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Corey Minyard, (Wed Oct 29, 8:22 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Wed Oct 29, 10:40 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 10:50 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Wed Oct 29, 10:51 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Thu Oct 30, 12:04 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Thu Oct 30, 12:05 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Peter Zijlstra, (Thu Oct 30, 4:04 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Peter Zijlstra, (Thu Oct 30, 4:12 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Thu Oct 30, 4:29 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Thu Oct 30, 4:30 am)
Re: [PATCH] udp: Introduce special NULL pointers for hlist ..., Stephen Hemminger, (Thu Oct 30, 8:51 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Paul E. McKenney, (Thu Oct 30, 11:25 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Eric Dumazet, (Fri Oct 31, 9:40 am)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., Paul E. McKenney, (Fri Oct 31, 8:10 pm)
Re: [PATCH 2/2] udp: RCU handling for Unicast packets., David Miller, (Sat Nov 1, 9:19 pm)
[PATCH 1/3] rcu: Introduce hlist_nulls variant of hlist, Eric Dumazet, (Thu Nov 13, 6:14 am)
[PATCH 2/3] udp: Use hlist_nulls in UDP RCU code, Eric Dumazet, (Thu Nov 13, 6:15 am)
[PATCH 4/3] rcu: documents rculist_nulls, Eric Dumazet, (Thu Nov 13, 9:02 am)
Re: [PATCH 4/3] rcu: documents rculist_nulls, Peter Zijlstra, (Fri Nov 14, 8:16 am)
Re: [PATCH 4/3] rcu: documents rculist_nulls, David Miller, (Sun Nov 16, 8:36 pm)
Re: [PATCH 1/3] rcu: Introduce hlist_nulls variant of hlist, Paul E. McKenney, (Wed Nov 19, 10:01 am)
Re: [PATCH 4/3] rcu: documents rculist_nulls, Paul E. McKenney, (Wed Nov 19, 10:07 am)
Re: [PATCH 2/3] udp: Use hlist_nulls in UDP RCU code, Paul E. McKenney, (Wed Nov 19, 10:29 am)
Re: [PATCH 2/3] udp: Use hlist_nulls in UDP RCU code, Eric Dumazet, (Wed Nov 19, 10:53 am)
Re: [PATCH 1/3] rcu: Introduce hlist_nulls variant of hlist, Paul E. McKenney, (Wed Nov 19, 11:46 am)
Re: [PATCH 1/3] rcu: Introduce hlist_nulls variant of hlist, Arnaldo Carvalho de Melo, (Wed Nov 19, 11:53 am)
Re: [PATCH 0/3] net: RCU lookups for UDP, DCCP and TCP pro ..., Christoph Lameter, (Wed Nov 19, 12:52 pm)
Re: [PATCH 1/3] rcu: Introduce hlist_nulls variant of hlist, Paul E. McKenney, (Wed Nov 19, 2:17 pm)
Re: [PATCH 1/3] rcu: Introduce hlist_nulls variant of hlist, Paul E. McKenney, (Wed Nov 19, 2:21 pm)
Re: [PATCH] net: Convert TCP/DCCP listening hash tables to ..., Paul E. McKenney, (Sun Nov 23, 12:17 pm)