public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Sewior <bigeasy@linutronix.de>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Peter Ziljstra <peterz@infradead.org>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Andrii Nakryiko <andrii@kernel.org>, bpf <bpf@vger.kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: uprobe splat in PREEMP_RT
Date: Wed, 2 Apr 2025 14:21:58 +0200	[thread overview]
Message-ID: <20250402122158.j_8VoHQ-@linutronix.de> (raw)
In-Reply-To: <CAEf4BzbVmUfDVEs1ndy5hr2YYA5xgt7NODjNhy4x+Syfbr1yaA@mail.gmail.com>

On 2025-04-01 15:01:55 [-0700], Andrii Nakryiko wrote:
> So, write_seqcount_begin()'s documentation states:
> 
> /**
>  * write_seqcount_begin() - start a seqcount_t write side critical section
>  * @s: Pointer to seqcount_t or any of the seqcount_LOCKNAME_t variants
>  *
>  * Context: sequence counter write side sections must be serialized and
>  * non-preemptible. Preemption will be automatically disabled if and
>  * only if the seqcount write serialization lock is associated, and
>  * preemptible.  If readers can be invoked from hardirq or softirq
>  * context, interrupts or bottom halves must be respectively disabled.
>  */
> 
> 
> In our case we cannot have readers invoked from hardirq/softirq. It's
> the writer that can be invoked from hardirq (timer).
> 
> So what did I do incorrectly here? Should I still disable hardirqs
> just to satisfy that seqprop_assert()?

You don't have a lock associated with the seqcount. The writer side
ensure that there can only be one writer because the timer can only fire
once.
The reader side uses raw_seqcount_try_begin() so it does not require the
writer to make progress. Meaning if it preempts the writer then it will
continue and make progress.
If these conditions remain, why not
s/write_seqcount_begin/raw_write_seqcount_begin// ? This would avoid the
checks as per "I know best" and I don't have a reason why a lock would
make sense to exclude multiple writers.

> Peter, any opinion?

Sebastian

  parent reply	other threads:[~2025-04-02 12:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01 21:04 uprobe splat in PREEMP_RT Alexei Starovoitov
2025-04-01 21:22 ` Steven Rostedt
2025-04-01 22:01   ` Andrii Nakryiko
2025-04-02 10:33     ` Oleg Nesterov
2025-04-02 10:57       ` Sebastian Sewior
2025-04-02 11:23         ` Oleg Nesterov
2025-04-02 12:13           ` Sebastian Sewior
2025-04-02 12:18             ` Oleg Nesterov
2025-04-02 12:24               ` Sebastian Sewior
2025-04-02 14:12                 ` Oleg Nesterov
2025-04-03  7:37                   ` Sebastian Sewior
2025-04-03 12:27                     ` Oleg Nesterov
2025-04-03 16:04                       ` Andrii Nakryiko
2025-04-02 16:15       ` Andrii Nakryiko
2025-04-02 16:57         ` Oleg Nesterov
2025-04-02 12:21     ` Sebastian Sewior [this message]
2025-04-02  9:10 ` Oleg Nesterov
2025-04-02 10:54   ` Sebastian Sewior
2025-04-02 11:20     ` Oleg Nesterov
2025-04-02 11:31       ` Oleg Nesterov
2025-04-02 12:06         ` Sebastian Sewior
2025-04-02 12:12           ` Oleg Nesterov
2025-04-02 12:16             ` Sebastian Sewior
2025-04-02 13:56               ` Oleg Nesterov
2025-04-02 14:23                 ` Oleg Nesterov
2025-04-03  9:08                   ` Sebastian Sewior
2025-04-03 12:11                     ` Oleg Nesterov
2025-04-03 12:43                       ` Oleg Nesterov

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=20250402122158.j_8VoHQ-@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /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