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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <492C80B3.4040209@cosmosbay.com>
Date:	Tue, 25 Nov 2008 23:48:19 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	"David S. Miller" <davem@...emloft.net>
CC:	Linux Netdev List <netdev@...r.kernel.org>
Subject: [PATCH] net: Use a percpu_counter for sockets_allocated

Hi David

I am working on the SMP scalability problem of socket
allocation / deallocation.

I'll submit seven patches on lkml for fs subsystem, but before that,
I would like to submit two network patches for net-next-2.6.

After all contended cache lines access on fs subsystem are avoided,
we hit two contention points on network side : socket_allocated and
orphan_count atomic's (for SOCK_STREAM sockets)

Thank you

[PATCH] net: Use a percpu_counter for sockets_allocated

Instead of using one atomic_t per protocol, use a percpu_counter
for "sockets_allocated", to reduce cache line contention on
heavy duty network servers. 

Note : We revert commit (248969ae31e1b3276fc4399d67ce29a5d81e6fd9
net: af_unix can make unix_nr_socks visbile in /proc),
since it is not anymore used after sock_prot_inuse_add() addition

Signed-off-by: Eric Dumazet <dada1@...mosbay.com>
---
 include/net/sctp/sctp.h |    1 +
 include/net/sock.h      |    2 +-
 include/net/tcp.h       |    2 +-
 net/core/sock.c         |   10 +++++++---
 net/ipv4/proc.c         |    3 ++-
 net/ipv4/tcp.c          |    8 ++++++--
 net/ipv4/tcp_ipv4.c     |    4 ++--
 net/ipv6/tcp_ipv6.c     |    2 +-
 net/sctp/protocol.c     |    6 +++++-
 net/sctp/socket.c       |    6 +++---
 net/unix/af_unix.c      |    1 -
 11 files changed, 29 insertions(+), 16 deletions(-)

View attachment "sockets_allocated.patch" of type "text/plain" (7021 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ