From: luyun <luyun_611@163.com>
To: bot+bpf-ci@kernel.org, andrii@kernel.org, eddyz87@gmail.com,
ihor.solodrai@linux.dev, ast@kernel.org, daniel@iogearbox.net,
memxor@gmail.com, martin.lau@linux.dev, song@kernel.org,
yonghong.song@linux.dev, jolsa@kernel.org, emil@etsalapatis.com,
shuah@kernel.org
Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
martin.lau@kernel.org, mason@kernel.org
Subject: Re: [PATCH bpf 1/2] selftests/bpf: Fix timing-dependent assertions in task work stress test
Date: Thu, 17 Sep 2026 20:31:31 +0800 [thread overview]
Message-ID: <d80f4015-6ef9-4ce8-bb77-b25e902b5059@163.com> (raw)
In-Reply-To: <80c4a1ad857e4007c54a10110ff85897791545942a2cb3be4d9f5e69cd17de82@mail.kernel.org>
在 2026/9/17 17:00, bot+bpf-ci@kernel.org 写道:
>> task_work_run() assumes every stress run observes both scheduler
>> contention and, when the delete thread is enabled, cancellation of at
>> least one pending callback.
>>
>> Neither outcome is guaranteed. Contention is observed only when another
>> scheduler selects the same one of 128 map values while its task work is
>> outstanding. A valid run can therefore have no scheduling errors. This
>> was reproduced with a single scheduler: more than one million callbacks
>> were scheduled and completed while schedule_error remained zero.
> This isn't a bug, but would it read more clearly to say something like 'the
> task_work_stress test helper' (or name the file) instead of the bare
> task_work_run() in the opening sentence? There are three functions with
> that name in the tree: kernel/task_work.c, prog_tests/test_task_work.c, and
> the static helper being changed here in prog_tests/task_work_stress.c, so
> the bare name could be mistaken for the kernel function on first reading.
Agreed. The opening sentence will be reworded to "The task_work_run()
helper in prog_tests/task_work_stress.c assumes ...", so it cannot be
mistaken for the kernel function of the same name.
> This isn't a bug, but was nthreads reduced locally to get the
> single-scheduler run quoted here? The test hardcodes 'int nthreads = 16;'
> (prog_tests/task_work_stress.c:50) and the only environment knob is
> BPF_TASK_WORK_TEST_TIME for the duration. A reader trying to reproduce the
> quoted numbers has no way to get there without editing the file. It might
> help to say so explicitly, or give the 16-thread numbers, since the test
> has no knob for the thread count.
Yes, that run came from a modified copy of the test with the scheduler
thread count reduced to 1. v2 will state this explicitly: "reproduced
with a modified copy of the test running a single scheduler thread
(nthreads is hardcoded to 16 and the test has no knob for it)".
These are commit message changes only; the code will be identical to
v1, and 2/2 is unchanged. If there are no further comments on the two
patches, I will send out v2 later.
Thanks,
Yun Lu
>> Likewise, a successful map deletion may remove a value after its
>> callback has completed. delete_success can therefore be nonzero without
>> callback_success being smaller than callback_scheduled.
>>
>> Drop the assertion that schedule_error is nonzero. Keep requiring exact
>> callback accounting when deletion is disabled. With deletion enabled,
>> allow equal counts but still reject callback_success greater than
>> callback_scheduled.
>>
>> Fixes: c6ae18e0af5e ("selftests/bpf: add bpf task work stress tests")
>> Signed-off-by: Yun Lu <luyun@kylinos.cn>
>
> ---
> 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/35199472874
next prev parent reply other threads:[~2026-09-17 12:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 8:08 [PATCH bpf 0/2] selftests/bpf: Fix task work false failures and cleanup Yun Lu
2026-09-17 8:08 ` [PATCH bpf 1/2] selftests/bpf: Fix timing-dependent assertions in task work stress test Yun Lu
2026-09-17 9:00 ` bot+bpf-ci
2026-09-17 12:31 ` luyun [this message]
2026-09-17 14:39 ` Alexei Starovoitov
2026-09-18 2:36 ` luyun
2026-09-17 8:08 ` [PATCH bpf 2/2] selftests/bpf: Clean up child when task_work__open() fails Yun Lu
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=d80f4015-6ef9-4ce8-bb77-b25e902b5059@163.com \
--to=luyun_611@163.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=mason@kernel.org \
--cc=memxor@gmail.com \
--cc=shuah@kernel.org \
--cc=song@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