Eric Dumazet 7123aaa3a1 af_unix: speedup /proc/net/unix
/proc/net/unix has quadratic behavior, and can hold unix_table_lock for
a while if high number of unix sockets are alive. (90 ms for 200k
sockets...)

We already have a hash table, so its quite easy to use it.

Problem is unbound sockets are still hashed in a single hash slot
(unix_socket_table[UNIX_HASH_TABLE])

This patch also spreads unbound sockets to 256 hash slots, to speedup
both /proc/net/unix and unix_diag.

Time to read /proc/net/unix with 200k unix sockets :
(time dd if=/proc/net/unix of=/dev/null bs=4k)

before : 520 secs
after : 2 secs

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-08 14:27:23 -07:00
..
2012-06-04 11:45:11 -04:00
2012-04-25 19:47:17 -04:00
2012-05-17 04:50:21 -04:00
2012-06-04 11:45:11 -04:00
2012-06-04 11:45:11 -04:00
2012-04-15 12:44:40 -04:00
2012-06-04 11:45:11 -04:00
2012-05-17 18:45:20 -04:00
2012-05-17 04:50:21 -04:00
2012-06-04 11:45:11 -04:00
2012-06-04 11:45:11 -04:00
2012-06-04 11:45:11 -04:00
2012-06-08 14:27:23 -07:00
2012-05-27 01:11:22 -04:00