Skip to content

af_unix: Introduce per-netns socket hash table.

Kuniyuki Iwashima lkml ltp netdev oe-lkp 3 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 0 repliesApplied 6/6
  2. v26 patches 1 replySuperseded
  3. v16 patches 8 repliesSuperseded

Changes in v3 from the cover letter

6th:
* Remove unix_table_locks from comments.
* Remove missed spin_unlock(&unix_table_locks) in unix_lookup_by_ino() (kernel test robot)

Patches in v3 All 6 applied

#Subject and filesSizeRepliesApplied
1/6af_unix: Clean up some sock_net() uses.net/unix/af_unix.c net/unix/diag.c+15 -210 repliesApplied
2/6af_unix: Include the whole hash table size in UNIX_HASH_SIZE.include/net/af_unix.h net/unix/af_unix.c net/unix/diag.c+15 -160 repliesApplied
3/6af_unix: Define a per-netns hash table.include/net/net_namespace.h include/net/netns/unix.h net/unix/af_unix.c+40 -60 repliesApplied
4/6af_unix: Acquire/Release per-netns hash table's locks.net/unix/af_unix.c net/unix/diag.c+66 -320 repliesApplied
5/6af_unix: Put a socket into a per-netns hash table.include/net/af_unix.h net/unix/af_unix.c net/unix/diag.c+23 -370 repliesApplied
6/6af_unix: Remove unix_table_locks.include/net/af_unix.h net/unix/af_unix.c net/unix/diag.c+9 -420 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 net-next 0/6] af_unix: Introduce per-netns socket hash table.

This series replaces unix_socket_table with a per-netns hash table and reduces lock contention and time on iterating over the list.

Note the 3rd-6th patches can be a single patch, but for ease of review, they are split into small changes without breakage.

Changes:
v3:
6th:
* Remove unix_table_locks from comments.
* Remove missed spin_unlock(&unix_table_locks) in unix_lookup_by_ino() (kernel test robot)

v2: https://lore.kernel.org/netdev/[email protected]/
3rd:
* Update changelog
* Remove holes from per-netns hash table structure
* Use kvmalloc_array() instead of kmalloc() (Eric Dumazet)
* Remove unnecessary parts in af_unix_init() (Eric Dumazet)
* Move err_sysctl label into ifdef block (kernel test robot)
* Remove struct netns_unix from struct net if CONFIG_UNIX is disabled
4th:
* Use spin_lock_nested() (kernel test robot)

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (6):
af_unix: Clean up some sock_net() uses.
af_unix: Include the whole hash table size in UNIX_HASH_SIZE.
af_unix: Define a per-netns hash table.
af_unix: Acquire/Release per-netns hash table's locks.
af_unix: Put a socket into a per-netns hash table.
af_unix: Remove unix_table_locks.

 include/net/af_unix.h       |   5 +-
 include/net/net_namespace.h |   2 +
 include/net/netns/unix.h    |   6 +
 net/unix/af_unix.c          | 228 +++++++++++++++++++-----------------
 net/unix/diag.c             |  49 ++++----
 5 files changed, 152 insertions(+), 138 deletions(-)
Signature · 1 line
2.30.2