Re: [RFC PATCH 7/8] selftests/bpf: add multi-stream sequentiality example model

From: Tejun Heo

Date: Tue Sep 08 2026 - 17:40:19 EST


Hello, Tao.

On Tue, 08 Sep 2026 18:01:42 +0800, Tao Cui wrote:

> + if (flags & IOCOST_COST_F_MERGE) {
> + base = 0;
> + goto out;

Please advance the stream position for merged bios too. With 4K IOs, a new
request at sector S sets expected to S+8. A merged bio at S+8 leaves it
there, so the next new request at S+16 is priced random.

> + s = bpf_map_lookup_elem(&stream_tab, &iocg_id);
> + if (!s)
> + return seqio + RU(nbytes, IOC_PAGE_SIZE) * page;

Once the 64-entry map fills, every new cgroup receives sequential prices,
including for random IO. Please note this limitation in the example.

Thanks.

--
tejun