From: Tao Cui <cui.tao@linux.dev>
To: tj@kernel.org, josef@toxicopanda.com, axboe@kernel.dk,
ast@kernel.org, alexei.starovoitov@gmail.com
Cc: cui.tao@linux.dev, 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, ameryhung@gmail.com
Subject: Re: [RFC PATCH v14 0/4] blk-iocost: BPF struct_ops cost model
Date: Tue, 1 Dec 2026 21:26:21 +0800 [thread overview]
Message-ID: <2f386c09-dce8-4d0a-8947-c216738b352c@linux.dev> (raw)
In-Reply-To: <20261118131029.797007-1-cui.tao@linux.dev>
Hello, Tejun,
在 2026/11/18 21:10, Tao Cui 写道:
> This series lets a BPF program take over the cost model of one
> device. The BPF model provides calc_cost() for charged IOs plus two
> transfer coefficients for the completion-time sizing, io.cost.model
> selects between the attached model and the builtin one, and enabling
> and disabling the controller stays with io.cost.qos.
>
> The builtin model is a linear formula derived from a handful of device
> parameters, and the right formula is device specific. A BPF model can
> be adapted to the device and updated without rebuilding the kernel.
I've been testing the model switching from this series locally. One
test runs two sequential 4K direct readers in the same cgroup, first
with model=linear, then switched to the BPF model.
With model=linear, both streams get priced as random by the cursor
heuristic and the cgroup builds up a large abs_vdebt; throughput drops
to about 2 MB/s. Switching to the BPF model prices the same streams
sequential and throughput goes back to around 30 MB/s.
The question is what happens to the per-iocg vtime state on the
switch. The debt and delays built up under the old model were priced
with coefficients that don't apply anymore, and paying them back can
keep the cgroup stalled for a long time. My current branch treats a
model switch as a fresh start: abs_vdebt and delay are cleared and
each active iocg's vtime is moved to the activation target budget, the
same one iocg_activate() gives a newly activated iocg.
I'd like to hear your opinion on this.
Thanks,
Tao
prev parent reply other threads:[~2026-12-01 13:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 13:10 [RFC PATCH v14 0/4] blk-iocost: BPF struct_ops cost model Tao Cui
2026-11-18 13:10 ` [RFC PATCH v14 1/4] blk-iocost: add BPF struct_ops cost model support Tao Cui
2026-11-29 19:10 ` Tejun Heo
2026-11-30 10:14 ` Tao Cui
2026-11-18 13:10 ` [RFC PATCH v14 2/4] blk-iocost: add iocost_ioc_tick tracepoint for per-period device summary Tao Cui
2026-11-18 13:49 ` bot+bpf-ci
2026-11-18 13:10 ` [RFC PATCH v14 3/4] selftests/bpf: add iocost cost model test Tao Cui
2026-11-18 13:41 ` sashiko-bot
2026-11-24 13:06 ` Tao Cui
2026-11-18 13:49 ` bot+bpf-ci
2026-11-18 13:10 ` [RFC PATCH v14 4/4] docs: cgroup-v2: document the iocost BPF cost model attachment Tao Cui
2026-11-18 13:17 ` [RFC PATCH v14 0/4] blk-iocost: BPF struct_ops cost model Tao Cui
2026-11-29 2:17 ` Tao Cui
2026-12-01 13:26 ` Tao Cui [this message]
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=2f386c09-dce8-4d0a-8947-c216738b352c@linux.dev \
--to=cui.tao@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox