public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ruan Bonan <bonan.ruan@u.nus.edu>,
	Steven Rostedt <rostedt@goodmis.org>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller-bugs@googlegroups.com,
	Aleksandr Nogikh <nogikh@google.com>, BPF <bpf@vger.kernel.org>
Subject: Re: [BUG] possible deadlock in __schedule (with reproducer available)
Date: Thu, 28 Nov 2024 07:03:49 +0800	[thread overview]
Message-ID: <20241127230349.1619-1-hdanton@sina.com> (raw)
In-Reply-To: <CAEf4BzYHeh_=iHOYL88pXXdHGZuAmQNM0jM+9iPUou+7+YLjjQ@mail.gmail.com>

On Tue, 26 Nov 2024 13:15:48 -0800 Andrii Nakryiko <andrii.nakryiko@gmail.com>
> On Mon, Nov 25, 2024 at 1:44 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, Nov 25, 2024 at 05:24:05AM +0000, Ruan Bonan wrote:
> >
> > > From the discussion, it appears that the root cause might involve
> > > specific printk or BPF operations in the given context. To clarify and
> > > possibly avoid similar issues in the future, are there guidelines or
> > > best practices for writing BPF programs/hooks that interact with
> > > tracepoints, especially those related to scheduler events, to prevent
> > > such deadlocks?
> >
> > The general guideline and recommendation for all tracepoints is to be
> > wait-free. Typically all tracer code should be.
> >
> > Now, BPF (users) (ab)uses tracepoints to do all sorts and takes certain
> > liberties with them, but it is very much at the discretion of the BPF
> > user.
> 
> We do assume that tracepoints are just like kprobes and can run in
> NMI. And in this case BPF is just a vehicle to trigger a
> promised-to-be-wait-free strncpy_from_user_nofault(). That's as far as
> BPF involvement goes, we should stop discussing BPF in this context,
> it's misleading.
> 
Given known issue, syzbot should run without bpf enabled before it is fixed
to avoid more useless discussing and misleading.

  reply	other threads:[~2024-11-27 23:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-23  3:39 [BUG] possible deadlock in __schedule (with reproducer available) Ruan Bonan
2024-11-23 20:27 ` Peter Zijlstra
2024-11-23 23:00   ` Steven Rostedt
2024-11-25  2:02     ` Alexei Starovoitov
2024-11-25  3:30       ` Steven Rostedt
2024-11-25  3:44         ` Steven Rostedt
2024-11-25  5:24           ` Ruan Bonan
2024-11-25  9:44             ` Peter Zijlstra
2024-11-26 21:15               ` Andrii Nakryiko
2024-11-27 23:03                 ` Hillf Danton [this message]
2024-11-28  2:27                   ` Alexei Starovoitov
2024-11-28  4:48                     ` Hillf Danton
2024-11-29  8:35 ` Masami Hiramatsu
2024-11-29 12:09   ` Peter Zijlstra
2024-12-01 12:53     ` Akinobu Mita

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=20241127230349.1619-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=bonan.ruan@u.nus.edu \
    --cc=bpf@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nogikh@google.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /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