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

From: Tejun Heo

Date: Wed Oct 28 2026 - 16:25:21 EST


Hello, Alexei.

On Wed, Oct 28, 2026 at 03:58:57PM +0000, Alexei Starovoitov wrote:
> Lets drop them. A struct_ops can get new members later, when a model
> needs them.
> I'd like to hear from Tejun whether such a model is planned.

The callbacks would only be worth having if they could do something
calc_cost() can't, e.g. sleep, but I forgot that pd allocations are
opportunistic to begin with. A blkg and its pds are created on the bio
path under queue_lock with GFP_NOWAIT, so iocg_init() can't sleep
either. Agreed, let's drop them.

> ...
> calc_cost() runs under rcu_read_lock(). bpf_map_put() frees a struct_ops
> map after an RCU gp. So detach doesn't need to freeze the queue.
> The rest fits into blk-iocost.c and patch 1 is not needed.

Agreed on both.

Thanks.

--
tejun