]> bbs.cooldavid.org Git - net-next-2.6.git/commit
inetpeer: various changes
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 14 Jun 2010 19:35:21 +0000 (19:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Jun 2010 06:13:08 +0000 (23:13 -0700)
commitd6cc1d642de9284cb26488ea390d915b50ee2504
tree7652471f541c11f63f54e282a04a9cba614e8d5e
parent6b10de38f0ef4e921a1f6e5cba2b6c92d6b46ecd
inetpeer: various changes

Try to reduce cache line contentions in peer management, to reduce IP
defragmentation overhead.

- peer_fake_node is marked 'const' to make sure its not modified.
  (tested with CONFIG_DEBUG_RODATA=y)

- Group variables in two structures to reduce number of dirtied cache
lines. One named "peers" for avl tree root, its number of entries, and
associated lock. (candidate for RCU conversion)

- A second one named "unused_peers" for unused list and its lock

- Add a !list_empty() test in unlink_from_unused() to avoid taking lock
when entry is not unused.

- Use atomic_dec_and_lock() in inet_putpeer() to avoid taking lock in
some cases.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inetpeer.c