mbox series

[v2,net-next,0/4] af_unix: Random improvements for GC.

Message ID 20231123014747.66063-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series af_unix: Random improvements for GC. | expand

Message

Kuniyuki Iwashima Nov. 23, 2023, 1:47 a.m. UTC
If more than 16000 inflight AF_UNIX sockets exist on a host, each
sendmsg() will be forced to wait for unix_gc() even if a process
is not sending any FD.

This series tries not to impose such a penalty on sane users.


Changes:
  v2:
    Patch 4: Fix build error when CONFIG_UNIX=n (kernel test robot)

  v1: https://lore.kernel.org/netdev/20231122013629.28554-1-kuniyu@amazon.com/


Kuniyuki Iwashima (4):
  af_unix: Do not use atomic ops for unix_sk(sk)->inflight.
  af_unix: Return struct unix_sock from unix_get_socket().
  af_unix: Run GC on only one CPU.
  af_unix: Try to run GC async.

 include/linux/io_uring.h |  4 +-
 include/net/af_unix.h    |  6 +--
 include/net/scm.h        |  1 +
 io_uring/io_uring.c      |  5 ++-
 net/core/scm.c           |  5 +++
 net/unix/af_unix.c       | 10 +++--
 net/unix/garbage.c       | 84 ++++++++++++++++++----------------------
 net/unix/scm.c           | 34 ++++++++--------
 8 files changed, 74 insertions(+), 75 deletions(-)

Comments

Ivan Babrou Nov. 29, 2023, 12:47 a.m. UTC | #1
On Wed, Nov 22, 2023 at 5:48 PM Kuniyuki Iwashima <kuniyu@amazon.com> wrote:
>
> If more than 16000 inflight AF_UNIX sockets exist on a host, each
> sendmsg() will be forced to wait for unix_gc() even if a process
> is not sending any FD.
>
> This series tries not to impose such a penalty on sane users.
>
>
> Changes:
>   v2:
>     Patch 4: Fix build error when CONFIG_UNIX=n (kernel test robot)
>
>   v1: https://lore.kernel.org/netdev/20231122013629.28554-1-kuniyu@amazon.com/
>
>
> Kuniyuki Iwashima (4):
>   af_unix: Do not use atomic ops for unix_sk(sk)->inflight.
>   af_unix: Return struct unix_sock from unix_get_socket().
>   af_unix: Run GC on only one CPU.
>   af_unix: Try to run GC async.
>
>  include/linux/io_uring.h |  4 +-
>  include/net/af_unix.h    |  6 +--
>  include/net/scm.h        |  1 +
>  io_uring/io_uring.c      |  5 ++-
>  net/core/scm.c           |  5 +++
>  net/unix/af_unix.c       | 10 +++--
>  net/unix/garbage.c       | 84 ++++++++++++++++++----------------------
>  net/unix/scm.c           | 34 ++++++++--------
>  8 files changed, 74 insertions(+), 75 deletions(-)
>
> --
> 2.30.2
>

LGTM. Not sure if reviewed-by is warranted from me, but you can at
least take tested-by.

Tested-by: Ivan Babrou <ivan@cloudflare.com>

Thank you for working on it.