mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: cui.tao@linux.dev,tj@kernel.org,josef@toxicopanda.com,axboe@kernel.dk
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,ast@kernel.org,daniel@iogearbox.net,linux-kselftest@vger.kernel.org,cui.tao@linux.dev,cuitao@kylinos.cn,ameryhung@gmail.com,alexei.starovoitov@gmail.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH 3/5] selftests/bpf: add iocost cost model test
Date: Wed, 28 Oct 2026 15:33:31 +0000 (UTC)	[thread overview]
Message-ID: <6e0cec7622bf79c97ff108b4c1499e28b0109ecc8fa9cc8f72cb3c4f1ba47ee8@mail.kernel.org> (raw)
In-Reply-To: <20261028143534.135968-4-cui.tao@linux.dev>

[-- Attachment #1: Type: text/plain, Size: 2188 bytes --]

> selftests/bpf: add iocost cost model test

TL;DR: Nit only: in the iocost_model selftest, the comment before the final
"pair_balanced_again" assertion describes the re-attach init check, not the
detach-time init/free pairing it actually tests.

> diff --git a/tools/testing/selftests/bpf/prog_tests/iocost_model.c b/tools/testing/selftests/bpf/prog_tests/iocost_model.c
> new file mode 100644
> index 000000000000..5373d52d93a6
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/iocost_model.c
> @@ -0,0 +1,806 @@

[ ... ]

> +void serial_test_iocost_model_removal(void)
> +{

[ ... ]

> +	err = iocost_model__attach(skel2);
> +	if (!ASSERT_OK(err, "attach_again"))
> +		goto out2;
> +
> +	err = readback_model(dev, model, sizeof(model));
> +	if (ASSERT_OK(err, "readback_again"))
> +		ASSERT_STREQ(model, "bpf", "model_bpf_again");
> +	ASSERT_GT(skel2->bss->iocg_inits, 0, "pair_init_again");
> +
> +	bpf_link__destroy(skel2->links.iocost_2x);
> +	skel2->links.iocost_2x = NULL;
> +
> +	err = readback_model(dev, model, sizeof(model));
> +	if (ASSERT_OK(err, "readback_after_detach_again"))
> +		ASSERT_STREQ(model, "linear", "model_linear_again");
> +
> +	/* the re-attach walk delivered init for the recreated device */
> +	ASSERT_EQ(skel2->bss->iocg_frees, skel2->bss->iocg_inits,
> +		  "pair_balanced_again");

This isn't a bug, but the comment above the final assertion doesn't seem to
describe the check below it.

The comment says "the re-attach walk delivered init for the recreated
device", while the assertion that follows compares iocg_frees against
iocg_inits after bpf_link__destroy(), which is the detach walk delivering a
matching iocg_free() for every iocg_init().  The init side is the
ASSERT_GT(skel2->bss->iocg_inits, 0, "pair_init_again") check a few lines
earlier, right after the attach.

Should this comment sit next to the "pair_init_again" check, or say that the
detach walk paired every init with a free?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/40710751825

  reply	other threads:[~2026-10-28 15:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 14:35 [RFC PATCH v11 0/5] blk-iocost: BPF struct_ops cost model Tao Cui
2026-10-28 14:35 ` [PATCH 1/5] blk-iocost: move shared definitions to blk-iocost.h Tao Cui
2026-10-28 20:09   ` Tejun Heo
2026-10-28 14:35 ` [PATCH 2/5] blk-iocost: add BPF struct_ops cost model support Tao Cui
2026-10-28 15:33   ` bot+bpf-ci
2026-10-28 20:09   ` Tejun Heo
2026-10-28 14:35 ` [PATCH 3/5] selftests/bpf: add iocost cost model test Tao Cui
2026-10-28 15:33   ` bot+bpf-ci [this message]
2026-10-28 20:09   ` Tejun Heo
2026-10-28 14:35 ` [PATCH 4/5] blk-iocost: add iocost_ioc_tick tracepoint for per-period device summary Tao Cui
2026-10-28 20:09   ` Tejun Heo
2026-10-28 14:35 ` [PATCH 5/5] docs: cgroup-v2: document the iocost BPF cost model attachment Tao Cui
2026-10-28 20:09   ` Tejun Heo
2026-10-28 15:58 ` [RFC PATCH v11 0/5] blk-iocost: BPF struct_ops cost model Alexei Starovoitov
2026-10-28 20:09   ` Tejun Heo
2026-10-28 20:09 ` Tejun Heo

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=6e0cec7622bf79c97ff108b4c1499e28b0109ecc8fa9cc8f72cb3c4f1ba47ee8@mail.kernel.org \
    --to=bot+bpf-ci@kernel.org \
    --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=cui.tao@linux.dev \
    --cc=cuitao@kylinos.cn \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=josef@toxicopanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=mason@kernel.org \
    --cc=tj@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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®