From 3428b96223ab626cc7b86b65eeab25fd42fceb0b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 13 Nov 2026 05:34:49 -0800 Subject: [PATCH] docs(uring): name the kernels that charge io_uring rings to RLIMIT_MEMLOCK Only Linux 6.14 up to the 7.3 fix (backported to stable) charges rings and provided-buffer rings to RLIMIT_MEMLOCK; other kernels charge them to the memory cgroup. Say so in the ENOMEM message and the docs. Co-Authored-By: Claude Opus 5.5 --- doc/bin/relay/config.md | 5 +++-- packaging/moq-relay/moq-relay.service | 4 ++-- rs/moq-uring/README.md | 4 +++- rs/moq-uring/src/error.rs | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/bin/relay/config.md b/doc/bin/relay/config.md index 4cef5b6ce84..4a20996c421 100644 --- a/doc/bin/relay/config.md +++ b/doc/bin/relay/config.md @@ -229,8 +229,9 @@ host has, would crowd onto them. Turn it on for a host the relay has to itself. `io_uring` additionally needs Linux 6.12+ and the `io-uring` cargo feature; it shares the same reloadable TLS identity and serves every configured version like the shared runtime. A setting the build or host cannot deliver refuses to -start rather than being ignored. If io\_uring workers fail to start naming -`RLIMIT_MEMLOCK`, raise it (`LimitMEMLOCK=` under systemd). +start rather than being ignored. Linux 6.14 up to the 7.3 fix (backported to +stable kernels) charges io\_uring rings to `RLIMIT_MEMLOCK`: if io\_uring workers +fail to start naming it, raise it (`LimitMEMLOCK=` under systemd). ## \[web] diff --git a/packaging/moq-relay/moq-relay.service b/packaging/moq-relay/moq-relay.service index 8af96bdf591..18fa557c751 100644 --- a/packaging/moq-relay/moq-relay.service +++ b/packaging/moq-relay/moq-relay.service @@ -17,8 +17,8 @@ RestartSec=5s RestartSteps=5 RestartMaxDelaySec=1min LimitNOFILE=1048576 -# io_uring workers charge their rings to RLIMIT_MEMLOCK (~56 KiB each), and hosts still on the old -# 64 KiB default fit one worker at most. +# Linux 6.14 up to the 7.3 fix charges io_uring rings to RLIMIT_MEMLOCK (~56 KiB per worker), and +# hosts still on the old 64 KiB default fit one worker at most. LimitMEMLOCK=infinity # Sandboxing. DynamicUser allocates a transient UID, StateDirectory creates diff --git a/rs/moq-uring/README.md b/rs/moq-uring/README.md index 6aa7c96550f..16220125551 100644 --- a/rs/moq-uring/README.md +++ b/rs/moq-uring/README.md @@ -152,7 +152,9 @@ just rs test -p moq-uring --release -E 'test(benchmark_socket_queues)' --run-ign ## Parallel test runs -Locked memory is charged per user across processes, not per nextest run. +Linux 6.14 up to the 7.3 fix (backported to stable kernels) charges rings to +locked memory per user across processes, not per nextest run; other kernels +charge them to the memory cgroup. Unit tests use 128 SQ entries and 512 CQ entries instead of the production 256/2048 geometry. Integration tests still exercise production rings. The nextest group allows four ring tests per invocation. Each socket-queue diff --git a/rs/moq-uring/src/error.rs b/rs/moq-uring/src/error.rs index b4a43aa6631..5abb50c5133 100644 --- a/rs/moq-uring/src/error.rs +++ b/rs/moq-uring/src/error.rs @@ -36,8 +36,9 @@ impl Error { Self::Io(std::io::Error::new( err.kind(), format!( - "{err}: io_uring memory counts against RLIMIT_MEMLOCK ({limit}), shared by every process of this user; \ - raise it with `ulimit -l` or systemd's `LimitMEMLOCK=`" + "{err}: Linux 6.14 until the 7.3 fix charges io_uring rings to RLIMIT_MEMLOCK ({limit}), shared by every \ + process of this user, so raise it with `ulimit -l` or systemd's `LimitMEMLOCK=`; other kernels charge \ + them to the memory cgroup" ), )) }