在 2026/9/17 22:39, Alexei Starovoitov 写道:
On Thu, Sep 17, 2026 at 04:08 PM Yun Lu <[email protected]> wrote:
From: Yun Lu <[email protected]>

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.
So it was "reproduced" by changing nthreads from 16 to 1 ?
That's not a fix. With 16 threads hammering 128 entries for a second
schedule_error > 0 and callback_success < callback_scheduled are the
point of the test. They check that the -EBUSY path in
bpf_task_work_acquire_ctx() and the cancel path in
bpf_task_work_cancel_and_free() were actual
ly exercised. Without them
the stress test only checks that nothing crashed.
If the unmodified test fails somewhere, show the log.

Hi, Alexei


Thanks for the clarification. You are right that the zero-contention
result was obtained only after locally changing nthreads from 16 to 1,
so it does not reproduce a failure of the unmodified stress test.

I reran the unmodified test with nthreads = 16 for 100 iterations in
the default environment, 100 iterations with all threads restricted to
one CPU, and 100 iterations in a single-vCPU QEMU guest. All runs
passed, so I do not have a failure log for the upstream test
configuration.



Patch 2 is fine on its own. Send it alone against bpf-next.


OK, I will drop patch 1 and resend patch 2 alone against bpf-next.


Thanks,

Yun Lu



pw-bot: cr


Reply via email to