Skip to content

Commit 91dd93f

Browse files
edumazetdavem330
authored andcommitted
netlink: move nl_table in read_mostly section
netlink sockets creation and deletion heavily modify nl_table_users and nl_table_lock. If nl_table is sharing one cache line with one of them, netlink performance is really bad on SMP. ffffffff81ff5f00 B nl_table ffffffff81ff5f0c b nl_table_users Putting nl_table in read_mostly section increased performance of my open/delete netlink sockets test by about 80 % This came up while diagnosing a getaddrinfo() problem. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent be346ff commit 91dd93f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netlink/af_netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static inline int netlink_is_kernel(struct sock *sk)
8989
return nlk_sk(sk)->flags & NETLINK_KERNEL_SOCKET;
9090
}
9191

92-
struct netlink_table *nl_table;
92+
struct netlink_table *nl_table __read_mostly;
9393
EXPORT_SYMBOL_GPL(nl_table);
9494

9595
static DECLARE_WAIT_QUEUE_HEAD(nl_table_wait);

0 commit comments

Comments
 (0)