mbox series

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

Message ID 20220621171913.73401-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series af_unix: Introduce per-netns socket hash table. | expand

Message

Kuniyuki Iwashima June 21, 2022, 5:19 p.m. UTC
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/20220620185151.65294-1-kuniyu@amazon.com/
    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/20220616234714.4291-1-kuniyu@amazon.com/


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(-)

Comments

patchwork-bot+netdevbpf@kernel.org June 22, 2022, 12:20 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 21 Jun 2022 10:19:07 -0700 you wrote:
> 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.
> 
> 
> [...]

Here is the summary with links:
  - [v3,net-next,1/6] af_unix: Clean up some sock_net() uses.
    https://git.kernel.org/netdev/net-next/c/340c3d337119
  - [v3,net-next,2/6] af_unix: Include the whole hash table size in UNIX_HASH_SIZE.
    https://git.kernel.org/netdev/net-next/c/f302d180c6d4
  - [v3,net-next,3/6] af_unix: Define a per-netns hash table.
    https://git.kernel.org/netdev/net-next/c/b6e811383062
  - [v3,net-next,4/6] af_unix: Acquire/Release per-netns hash table's locks.
    https://git.kernel.org/netdev/net-next/c/79b05beaa5c3
  - [v3,net-next,5/6] af_unix: Put a socket into a per-netns hash table.
    https://git.kernel.org/netdev/net-next/c/cf2f225e2653
  - [v3,net-next,6/6] af_unix: Remove unix_table_locks.
    https://git.kernel.org/netdev/net-next/c/2f7ca90a0188

You are awesome, thank you!