Skip to content

af_unix: Random improvements for GC.

Kuniyuki Iwashima netdev 6 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 0 repliesApplied 5/5
  2. v44 patches 2 repliesSuperseded
  3. v3 posting 2/20 of 4 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v3 posting 1/24 patches0 repliesSuperseded
v24 patches7 repliesSuperseded
v14 patches0 repliesSuperseded

Changes in v5 from the cover letter

* Rebase on the latest
* Add patch 1

Patches in v5 All 5 applied

#Subject and filesSizeRepliesApplied
1/5af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc().net/unix/garbage.c+1 -10 repliesApplied
2/5af_unix: Do not use atomic ops for unix_sk(sk)->inflight.include/net/af_unix.h net/unix/af_unix.c net/unix/garbage.c +1 more+16 -150 repliesApplied
3/5af_unix: Return struct unix_sock from unix_get_socket().include/net/af_unix.h net/unix/garbage.c net/unix/scm.c+15 -250 repliesApplied
4/5af_unix: Run GC on only one CPU.net/unix/garbage.c+27 -270 repliesApplied
5/5af_unix: Try to run GC async.include/net/af_unix.h include/net/scm.h net/core/scm.c +2 more+29 -50 repliesApplied

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchSimon HormanPavel Begunkov
1/5
2/5R-b
3/5R-b A-b
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 net-next 0/5] af_unix: Random improvements for GC.

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 who do not send AF_UNIX FDs or do not have inflight sockets more than SCM_MAX_FD * 8.

The first patch can be backported to -stable.

Cleanup patches for commit 69db702c8387 ("io_uring/af_unix: disable sending io_uring over sockets") and large refactoring of GC will be followed later.

Changes:
v5:
* Rebase on the latest
* Add patch 1

v4: https://lore.kernel.org/netdev/[email protected]/
* Rebase on the latest

v3: https://lore.kernel.org/netdev/[email protected]/
* Patch 3
* Reuse gc_in_progress flag.
* Call flush_work() only when gc is queued or in progress.
* Patch 4
* Bump UNIX_INFLIGHT_SANE_USER to (SCM_MAX_FD * 8).

v2: https://lore.kernel.org/netdev/[email protected]/
* Patch 4
* Fix build error when CONFIG_UNIX=n

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

Kuniyuki Iwashima (5):
af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc().
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/net/af_unix.h | 14 +++++--
 include/net/scm.h     |  1 +
 net/core/scm.c        |  5 +++
 net/unix/af_unix.c    | 10 +++--
 net/unix/garbage.c    | 98 ++++++++++++++++++++++---------------------
 net/unix/scm.c        | 27 ++++++------
 6 files changed, 85 insertions(+), 70 deletions(-)
Signature · 1 line
2.30.2