public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-kernel@vger.kernel.org,
	Michael Jeanson <mjeanson@efficios.com>,
	Alexei Starovoitov <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	bpf@vger.kernel.org, Joel Fernandes <joel@joelfernandes.org>
Subject: Re: [PATCH v4 1/5] tracing: Introduce faultable tracepoints
Date: Tue, 21 Nov 2023 18:31:40 +0100	[thread overview]
Message-ID: <20231121173140.GO4779@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20231121165029.GL8262@noisy.programming.kicks-ass.net>

On Tue, Nov 21, 2023 at 05:50:29PM +0100, Peter Zijlstra wrote:
> On Tue, Nov 21, 2023 at 11:00:13AM -0500, Mathieu Desnoyers wrote:
> > On 2023-11-21 10:52, Peter Zijlstra wrote:
> > > On Tue, Nov 21, 2023 at 03:46:43PM +0100, Peter Zijlstra wrote:
> > > 
> > > > Why is this such a hard question?
> > > 
> > > Anyway, recapping from IRC:
> > > 
> > > preemptible, SRCU:
> > >    counter-array based, GP advances by increasing array index
> > >    and waiting for previous index to drop to 0.
> > > 
> > >    notably, a GP can pass while a task is preempted but not within a
> > >    critical section.
> > > 
> > >    SRCU has smp_mb() in the critical sections to improve GP.
> > 
> > Also:
> > 
> > preemptible only allows blocking when priority inheritance is
> > guarantees, which excludes doing I/O, and thus page faults.
> > Otherwise a long I/O could cause the system to OOM.
> > 
> > SRCU allows all kind of blocking, as long as the entire SRCU
> > domain does not mind waiting for a while before readers complete.
> 
> Well, no. Fundamentally both SRCU and preemptible (and many other
> flavours) are just a counter-array. The non-blocking for preempt comes
> from the fact that it is the main global rcu instance and allowing all
> that would make GPs too rare and cause you memory trouble.
> 
> But that's not because of how it's implemented, but because of it being
> the main global instance.
> 
> > > tasks:
> > >    waits for every task to pass schedule()
> > > 
> > >    ensures that any pieces of text rendered unreachable before, is
> > >    actually unused after.
> > > 
> > > tasks-rude:
> > >    like tasks, but different? build to handle tracing while rcu-idle,
> > >    even though that was already deemed bad?
> > > 
> > > tasks-tracing-rcu:
> > >    extention of tasks to have critical-sections ? Should this simply be
> > >    tasks?
> > 
> > tasks-trace-rcu is meant to allow tasks to block/take a page fault within
> > the read-side. It is specialized for tracing and has a single domain. It
> > does not need the smp_mb on the read-side, which makes it lower-overhead
> > than SRCU.
> 
> That's what it's meant for, not what it is.
> 
> Turns out that tasks-tracing is a per-task counter based thing, and as
> such does not require all tasks to pass through schedule() and does not
> imply the tasks flavour (nor the tasks-rude) despite the similarity in
> naming.
> 
> But now I am again left wondering what the fundamental difference is
> between a per-task counter and a per-cpu counter.
> 
> At the end of the day, you still have to wait for the thing to hit 0.
> 
> So I'm once again confused, ...

Updating myself.. so task-tracing-rcu is in fact *very* similar to
regular preemptible-rcu but is slightly different mostly because it is
*not* the main global instance.

Both are a single per-task counter (and not the per-cpu summing that I
remember from many many *many* years ago; OLS'07), mostly because this
helps identify which task is to blame when things go sideways.



  reply	other threads:[~2023-11-21 17:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 20:54 [PATCH v4 0/5] Faultable Tracepoints Mathieu Desnoyers
2023-11-20 20:54 ` [PATCH v4 1/5] tracing: Introduce faultable tracepoints Mathieu Desnoyers
2023-11-20 21:47   ` Peter Zijlstra
2023-11-20 22:18     ` Paul E. McKenney
2023-11-20 22:23       ` Peter Zijlstra
2023-11-20 23:56         ` Paul E. McKenney
2023-11-21  8:47           ` Peter Zijlstra
2023-11-21 14:06             ` Mathieu Desnoyers
2023-11-21 14:36               ` Peter Zijlstra
2023-11-21 14:40                 ` Mathieu Desnoyers
2023-11-21 14:46                   ` Peter Zijlstra
2023-11-21 14:56                     ` Mathieu Desnoyers
2023-11-21 15:51                       ` Paul E. McKenney
2023-11-21 15:52                     ` Peter Zijlstra
2023-11-21 16:00                       ` Mathieu Desnoyers
2023-11-21 16:07                         ` Steven Rostedt
2023-11-21 16:11                           ` Mathieu Desnoyers
2023-11-21 16:43                             ` Paul E. McKenney
2023-11-21 16:50                         ` Peter Zijlstra
2023-11-21 17:31                           ` Peter Zijlstra [this message]
2023-11-21 16:41                       ` Paul E. McKenney
2023-11-21 14:44                 ` Steven Rostedt
2023-11-21 16:45                   ` Paul E. McKenney
2023-11-21 15:58                 ` Paul E. McKenney
2023-11-21 16:03                   ` Peter Zijlstra
2023-11-21 16:46                     ` Paul E. McKenney
2023-11-20 22:20   ` Steven Rostedt
2024-06-20 15:38     ` Mathieu Desnoyers
2023-11-20 20:54 ` [PATCH v4 2/5] tracing/ftrace: Add support for " Mathieu Desnoyers
2023-11-20 22:15   ` Peter Zijlstra
2024-06-20 15:04     ` Mathieu Desnoyers
2023-11-20 20:54 ` [PATCH v4 3/5] tracing/bpf-trace: add " Mathieu Desnoyers
2023-11-20 20:54 ` [PATCH v4 4/5] tracing/perf: " Mathieu Desnoyers
2023-11-20 20:54 ` [PATCH v4 5/5] tracing: convert sys_enter/exit to " Mathieu Desnoyers
2023-11-20 21:46   ` Peter Zijlstra
2024-06-20 15:05     ` Mathieu Desnoyers

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=20231121173140.GO4779@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mjeanson@efficios.com \
    --cc=namhyung@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=yhs@fb.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