From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Tao Cui" <cui.tao@linux.dev>, <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>, <daniel@iogearbox.net>,
<linux-kselftest@vger.kernel.org>, <cuitao@kylinos.cn>
Subject: Re: [RFC PATCH v5 1/5] blk-iocost: add BPF struct_ops cost model support
Date: Fri, 18 Sep 2026 15:43:50 +0000 [thread overview]
Message-ID: <DLIK37JYD35X.3NZ4ZHTHDKAFX@gmail.com> (raw)
In-Reply-To: <20260918031751.1255420-2-cui.tao@linux.dev>
On Fri, Sep 18, 2026 at 11:17 AM Tao Cui <cui.tao@linux.dev> wrote:
> The registration and binding model follows the TCP congestion
> model registration pattern: registering a struct_ops makes the model
> available by its name (char name[IOCOST_MODEL_NAME_LEN], validated at
> init_member), while
> io.cost.model binds one registered model to a device with
> "model=<name>" and unbinds with "model=linear" or "ctrl=auto/user".
> Unregistering a model removes it from the registry, but its name
I don't think it's what Tejun asked for in v1. He asked for a per-device
struct_ops instance where attaching switches the device to bpf and
detaching switches it back. Instead there is a global name registry,
a lifecycle list, an "unregistered but still bound" state and a
refcount_t on top of bpf_struct_ops_get(), and every version since v3
had a lifetime bug in exactly that code.
Do it like hid_bpf_ops does with hid_id: device in the struct_ops,
bind in .reg, unbind in .unreg, and le
t struct_ops own the lifetime.
pls wait for Tejun's feedback before respinning.
pw-bot: cr
next prev parent reply other threads:[~2026-09-18 15:43 UTC|newest]
Thread overview: 8+ 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 15:43 ` Alexei Starovoitov [this message]
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 ` [RFC PATCH v5 5/5] docs: cgroup-v2: document io.cost model=<name> binding Tao Cui
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=DLIK37JYD35X.3NZ4ZHTHDKAFX@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=axboe@kernel.dk \
--cc=bpf@vger.kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=cui.tao@linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®