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

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

On Tue, 08 Sep 2026 18:01:42 +0800, Tao Cui wrote:
quoted hunk ↗ jump to hunk
+	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.
quoted hunk ↗ jump to hunk
+		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
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