> diff --git a/Documentation/admin-guide/cgroup-v2.rst 
> b/Documentation/admin-guide/cgroup-v2.rst
> index 86a2a0099178e..5786d86eceeae 100644
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst

[ ... ]

> @@ -2120,6 +2120,18 @@ IO Interface Files
>       parameters are written to, "ctrl" become "user" and the
>       automatic changes are disabled.
>
> +     When CONFIG_BLK_CGROUP_IOCOST_BPF is enabled, "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 so it can no
> +     longer be selected; devices already bound keep using it, and keep
> +     receiving cgroup lifecycle notifications, until switched back to
> +     the builtin model.  See
> +     include/linux/blk-iocost.h for the model interface.
> +

Does this section need to document what io.cost.model reads back with
a BPF model bound?

Looking at ioc_cost_model_prfill() in block/blk-iocost.c, when a BPF
model is bound, the file prints:

    seq_printf(sf, "%s ctrl=%s model=%s\n",
        dname, model ? "bpf" : ioc->user_cost_model ? "user" : "auto",
        model ? model->name : "linear");

So with a model bound, io.cost.model reads back "ctrl=bpf model=<name>".

The nested-key table nine lines above this paragraph lists the possible
values:

    =====           ================================
    ctrl            "auto" or "user"
    model           The cost model in use - "linear"
    =====           ================================

This table doesn't include "bpf" as a ctrl value or "<name>" as a model
value. The new paragraph also doesn't mention that "ctrl=bpf" is accepted
on write - ioc_cost_model_write() special-cases it so saved configurations
can be restored:

    } else if (!strcmp(buf, "bpf")) {
        /* readback value; keep the bound model */
        continue;
    }

Should the table be updated to include the "bpf" ctrl value and the
"<name>" model value, so the section documents what the kernel actually
prints?


---
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/35070283830

Reply via email to