From: Tao Cui <cui.tao@linux.dev>
To: tj@kernel.org, josef@toxicopanda.com, axboe@kernel.dk,
ameryhung@gmail.com
Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
andrii@kernel.org, eddyz87@gmail.com, ast@kernel.org,
daniel@iogearbox.net, linux-kselftest@vger.kernel.org,
cui.tao@linux.dev, cuitao@kylinos.cn
Subject: [RFC PATCH v5 5/5] docs: cgroup-v2: document io.cost model=<name> binding
Date: Fri, 18 Sep 2026 11:17:51 +0800 [thread overview]
Message-ID: <20260918031751.1255420-6-cui.tao@linux.dev> (raw)
In-Reply-To: <20260918031751.1255420-1-cui.tao@linux.dev>
From: Tao Cui <cuitao@kylinos.cn>
Document the named-model binding of io.cost.model in the
io.cost.model section of the cgroup v2 documentation: the binding
and restore syntax, the unknown-name rejection, the full-replacement
semantics of a bound model and the unregister lifetime.
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
---
Documentation/admin-guide/cgroup-v2.rst | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 8d2603751c51a..1cd0ecae9a940 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -2115,8 +2115,10 @@ IO Interface Files
are defined.
===== ================================
- ctrl "auto" or "user"
+ ctrl "auto", "user" or "bpf"
model The cost model in use - "linear"
+ or the name of the bound
+ model
===== ================================
When "ctrl" is "auto", the kernel may change all parameters
@@ -2124,6 +2126,23 @@ IO Interface Files
parameters are written to, "ctrl" become "user" and the
automatic changes are disabled.
+ When CONFIG_BLK_CGROUP_IOCOST_BPF is enabled, a bound model is
+ read back as "ctrl=bpf model=<name>", and writing "ctrl=bpf" is
+ accepted as a no-op so a saved configuration can be restored as-is.
+ "model" also accepts
+ the name of a registered iocost_model_ops BPF struct_ops model:
+ "model=<name>" binds the model to the device and the model fully
+ replaces the builtin linear pricing, for every operation including
+ flushes; "model=linear" (or "ctrl=auto/user") restores the builtin
+ model. Writing an unknown name fails with ENOENT and nothing is
+ applied. Unregistering a model removes its name from the
+ registry; devices already bound keep using it, and keep receiving
+ cgroup lifecycle notifications, until switched back to the builtin
+ model, and its name keeps working for writes (so a coefficient-only
+ write does not disturb the binding) until the last device unbinds.
+ See
+ include/linux/blk-iocost.h for the model interface.
+
When "model" is "linear", the following model parameters are
defined.
--
2.43.0
next prev parent reply other threads:[~2026-09-18 3:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 3:17 [RFC PATCH v5 0/5] blk-iocost: BPF struct_ops cost model Tao Cui
2026-09-18 3:17 ` [RFC PATCH v5 1/5] blk-iocost: add BPF struct_ops cost model support Tao Cui
2026-09-18 3:29 ` sashiko-bot
2026-09-18 15:43 ` Alexei Starovoitov
2026-09-19 7:34 ` Tao Cui
2026-09-18 3:17 ` [RFC PATCH v5 2/5] selftests/bpf: add iocost cost model test Tao Cui
2026-09-18 3:17 ` [RFC PATCH v5 3/5] blk-iocost: add iocost_ioc_tick tracepoint for per-period device summary Tao Cui
2026-09-18 3:17 ` [RFC PATCH v5 4/5] selftests/bpf: add multi-stream sequentiality example model Tao Cui
2026-09-18 3:17 ` Tao Cui [this message]
2026-09-18 5:48 ` [RFC PATCH v5 0/5] blk-iocost: BPF struct_ops cost model Tao Cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260918031751.1255420-6-cui.tao@linux.dev \
--to=cui.tao@linux.dev \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=axboe@kernel.dk \
--cc=bpf@vger.kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=cuitao@kylinos.cn \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=josef@toxicopanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.