Re: [RFC PATCH 0/8] blk-iocost: BPF struct_ops cost model

From
Tejun Heo <tj@kernel.org>
Date
2026-09-08 21:03:34
Also in
bpf, cgroups, linux-kselftest, lkml
Reply to
Tao Cui, 2026-09-08
Hello, Tao.

On Tue, 08 Sep 2026 18:01:35 +0800, Tao Cui wrote:
 4. One model system-wide vs named models selectable per device (as
    tcp-cc names are per-socket)?
The struct_ops instance should be per-device. Loading a model for a device
should switch it to BPF automatically. Switching back to the builtin model
should detach the struct_ops.
 2. Per-cgroup state lifetime: iocg_id is the css id and is recycled
    once the cgroup is removed, so models must treat it as a
    transient key.  Does the interface need a release(iocg_id)
    callback so models can clean up per-cgroup state instead of
    detecting reuse, or is per-cgroup bpf local storage, which
    carries its own lifetime, the better home for model state?
I'd pass blkcg as a kptr and add online/offline callbacks so the model can
manage its per-cgroup state.
return value of 0 delegates the IO back to the builtin formula, so a
model which only handles some IO types cannot make the rest free.
I don't think mixing BPF and builtin pricing makes sense, either per IO or
between charging and request sizing. It seems convoluted and error-prone.
Implementing the linear model in BPF is straightforward.

Please combine the interface, registration, dispatch and configuration
changes into one patch. These patches are small and implement one feature.

Thanks.

-- 
tejun
Thread (16 messages) 16 messages, 2 authors, last reply 2026-09-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help