From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Qiliang Yuan" <odys.yuan@gmail.com>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Ihor Solodrai" <ihor.solodrai@linux.dev>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
"Shuah Khan" <shuah@kernel.org>
Cc: <bpf@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next] selftests/bpf: Drop the on_enter recursion check of task_local_storage
Date: Wed, 21 Oct 2026 00:02:27 +0000 [thread overview]
Message-ID: <DMA2QEUR2QCK.TYMC6ONTPOZB@gmail.com> (raw)
In-Reply-To: <20261009-selftests-bpf-task-ls-recursion-v1-1-c3a3e3c41f8c@gmail.com>
On Thu, Oct 08, 2026 at 06:49 PM Qiliang Yuan <odys.yuan@gmail.com> wrote:
> other tasks. On a preemptible kernel, a task can be preempted while it
> runs on_enter, and a task entering a syscall on the same CPU then misses
> the program. With other tests running in parallel, on_enter ends up
> with recursion misses that have nothing to do with the test task, and
> the check expecting none fails.
Show the log of the failed run.
How many workers and how often does it fail?
> Drop the check. map_a holding 200, which only on_enter of the test task
> writes, already shows that on_enter ran for it.
The race works the other way too.
When another task is preempted inside on_enter and the test task calls
sys_gettid() on that cpu it's the test task that misses on_enter.
Nothing is created and "lookup map_a" fails with ENOENT.
enter_cnt == 2 in test_sys_enter_exit() has the same problem.
sys_enter is only a trigger here.
Make on_enter SEC("raw_tp") and run it with bpf_prog_test_run_opts()
like you did in enable_stats ?
Then no other task runs it and the check can stay.
> Fixes: 387b532138ee ("selftests/bpf: Tracing prog can still do lookup under busy lock")
Wrong tag. In 2022 the check was fine.
Progs attached to sys_enter were running with preemption disabled until
commit 439ebd5b5708 ("bpf: Add sleepable support for raw tracepoint programs").
Say that in the commit log.
pw-bot: cr
prev parent reply other threads:[~2026-10-21 0:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 1:49 Qiliang Yuan
2026-10-21 0:02 ` Alexei Starovoitov [this message]
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=DMA2QEUR2QCK.TYMC6ONTPOZB@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@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-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=odys.yuan@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
all inboxes | Powered by JetHome®