> docs: cgroup-v2: document the iocost BPF cost model attachment

TL;DR: Commit message only: it claims the docs cover detach restoring the
builtin model and ctrl= never selecting a model, but the added text may not
say either; add a sentence or trim the message.

> docs: cgroup-v2: document the iocost BPF cost model attachment
>
> Document the BPF cost model attachment in the io.cost.model section
> of the cgroup v2 documentation: attaching an iocost_model_ops
> struct_ops to a device by its major:minor, the model=bpf readback
> while attached (ctrl keeps describing the coefficients), that
> detaching restores the builtin model, and that ctrl= writes never
> select a model.
>
> Signed-off-by: Tao Cui <[email protected]>

The commit message says the patch documents "that detaching restores the
builtin model, and that ctrl= writes never select a model".  Does the added
text actually cover both of those points?

The new paragraph says:

    only detaching removes the model, after which "model=bpf" fails.
    "ctrl" keeps describing the builtin coefficients, ...

It never says that the device goes back to the builtin model on detach,
although ioc_bpf_detach() clears ioc->model and the readback then shows
"linear".

It also never says that a ctrl= write cannot select the BPF model.  That
is what the code does:

block/blk-iocost.c:ioc_cost_model_write() {
    ...
    accepts only ctrl=auto and ctrl=user, and any other value takes
    'goto unlock' and returns -EINVAL
    ...
}

Could a sentence be added to the documentation saying that "ctrl" accepts
only "auto" or "user" and that detaching returns the device to the builtin
model?  Otherwise, could those two clauses be dropped from the commit
message?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/36689638400

Reply via email to