All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC net-next 0/2] af_unix: Per-socket datagram queue length
@ 2026-12-02  7:09 ` Ishu Brar
  0 siblings, 0 replies; 8+ messages in thread
From: Ishu Brar via B4 Relay @ 2026-12-02  7:09 UTC (permalink / raw)
  To: Richard Henderson, Matt Turner, Magnus Lindholm,
	Thomas Bogendoerfer, James E.J. Bottomley, Helge Deller,
	David S. Miller, Andreas Larsson, Arnd Bergmann,
	Kuniyuki Iwashima, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Willem de Bruijn, Simon Horman, Shuah Khan
  Cc: linux-alpha, linux-mips, linux-parisc, sparclinux, linux-arch,
	netdev, linux-kernel, linux-kselftest, Christian Brauner,
	Ishu Brar

Datagram queue length of AF_UNIX socket is copied from
net.unix.max_dgram_qlen at creation, can't be changed later. journald's
/dev/log is created by PID 1 before sysctl.d runs, and kept across
journald restarts, so admin's value never reaches it, all syslog(3)
callers share one queue, systemd works around it with global sysctl bump
early in boot [1]. Lennart asked for socket option instead [1], it's
also KF.71 on UAPI group wishlist [2].

Patch 1 adds SO_MAX_DGRAM_QLEN for SOCK_DGRAM sockets, patch 2 adds
selftest. Tested in virtme-ng VM (x86_64, clang, PROVE_LOCKING), 6/6
pass, no lockdep reports, both wakeup cases fail when wake_up call is
removed.

Questions for this RFC:

1. Permission, going above netns sysctl needs CAP_NET_ADMIN in user ns
   owning netns, since sysctl can be set there after commit cec16052d5a7
   ("net: Enable max_dgram_qlen unix sysctl to be configurable by
   non-init user namespaces"). Or init_user_ns, like SO_RCVBUFFORCE?

2. Read-back, no getsockopt(), af_unix has no unix_getsockopt() yet, and
   sock_diag shows sk_max_ack_backlog only for listening sockets. Add
   one of them?

SO_RCVBUF is no alternative, AF_UNIX datagram sockets don't check
receiver's sk_rcvbuf.

AI was used to write selftest and edit this message

[1] https://github.com/systemd/systemd/issues/45144
[2] https://github.com/uapi-group/kernel-features

Signed-off-by: Ishu Brar <patches@brar.si>
---
Ishu Brar (2):
      af_unix: Add SO_MAX_DGRAM_QLEN for per-socket datagram queue length
      selftests: af_unix: Add test for SO_MAX_DGRAM_QLEN

 arch/alpha/include/uapi/asm/socket.h             |   2 +
 arch/mips/include/uapi/asm/socket.h              |   2 +
 arch/parisc/include/uapi/asm/socket.h            |   2 +
 arch/sparc/include/uapi/asm/socket.h             |   2 +
 include/uapi/asm-generic/socket.h                |   2 +
 net/unix/af_unix.c                               |  27 ++-
 tools/testing/selftests/net/af_unix/Makefile     |   1 +
 tools/testing/selftests/net/af_unix/dgram_qlen.c | 243 +++++++++++++++++++++++
 8 files changed, 280 insertions(+), 1 deletion(-)
---
base-commit: 0a837a30e55bbea2afb01cf0b3ec0c1d789a73ad
change-id: 20261202-af-unix-dgram-qlen-1112c811d5cf

Best regards,
--  
Ishu Brar <patches@brar.si>



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-12-03  7:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  7:09 [PATCH RFC net-next 0/2] af_unix: Per-socket datagram queue length Ishu Brar via B4 Relay
2026-12-02  7:09 ` Ishu Brar
2026-12-02  7:09 ` [PATCH RFC net-next 1/2] af_unix: Add SO_MAX_DGRAM_QLEN for per-socket " Ishu Brar via B4 Relay
2026-12-02  7:09   ` Ishu Brar
2026-12-03  7:09   ` sashiko-bot
2026-12-02  7:09 ` [PATCH RFC net-next 2/2] selftests: af_unix: Add test for SO_MAX_DGRAM_QLEN Ishu Brar
2026-12-02  7:09   ` Ishu Brar via B4 Relay
2026-12-03  7:09   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.