public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Joel Fernandes <joel@joelfernandes.org>,
	byungchul.park@lge.com, mathieu.desnoyers@efficios.com,
	Josh Triplett <josh@joshtriplett.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	linux-kernel@vger.kernel.org, kernel-team@android.com
Subject: Re: Tasks RCU vs Preempt RCU
Date: Tue, 22 May 2018 09:09:49 -0700	[thread overview]
Message-ID: <20180522160949.GU3803@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180522083832.45353d5f@gandalf.local.home>

On Tue, May 22, 2018 at 08:38:32AM -0400, Steven Rostedt wrote:
> On Mon, 21 May 2018 21:54:14 -0700
> Joel Fernandes <joel@joelfernandes.org> wrote:
> 
> 
> > Yes, lets brain storm this if you like. One way I was thinking if we can
> > manually check every CPU and see what state its in (usermode, kernel, idle
> > etc) using an IPI mechanism. Once all CPUs have been seen to be in usermode,
> > or idle atleast once - then we are done. You have probably already thought
> 
> Nope, it has nothing to do with CPUs, it really has to do with tasks.
> 
> 	CPU0
> 	----
>  task 1: (pinned to CPU 0)
> 	 call func_tracer_trampoline
> 	 [on trampoline]
> 	 [timer tick, schedule ]
> 
>  task 2: (higher priority, also pinned to CPU 0)
> 	 goes to user space
> 	 [ Runs for along time ]
> 
> We cannot free the trampoline until task 2 releases the CPU and lets
> task 1 run again to get off the CPU.

What Steven said!  IPIs get to CPUs, but we need to handle the
(unlikely, but very real) case where a bunch of tasks are preempted
within trampolines.

> > about this so feel free to say why its not a good idea, but to me there are 3
> > places that a tasks quiescent state is recorded: during the timer tick,
> > during task sleep and during rcu_note_voluntary_context_switch in
> > cond_resched_rcu_qs. Of these, I feel only the cond_resched_rcu_qs case isn't
> > trackable with IPI mechanism which may make the detection a bit slower, but
> > tasks-RCU in mainline is slow right now anyway (~ 1 second delay if any task
> > was held).
> 
> The way I was originally going to handle this was with a per task
> counter, where it can be incremented at certain points via tracepoints.
> 
> Thus my synchronize tasks, would have connected to a bunch of
> tracepoints at known quiescent states that would increment the counter,
> and then check each task until they all pass a certain point, or are in
> a quiescent state (userspace or idle). But this would be doing much of
> what RCU does today, and that is why we decided to hook with the RCU
> infrastructure.

Just for the record, if you guys realy want to take over Tasks RCU,
I have no objections.  For one thing, I don't anticipate any other use
cases for it (famous last words!).  But you break it, you buy it!  ;-)

							Thanx, Paul

> I have to ask, what's your motivation for getting rid of RCU tasks?
> 
> -- Steve
> 

  reply	other threads:[~2018-05-22 16:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 18:36 Tasks RCU vs Preempt RCU Joel Fernandes
2018-05-19  2:29 ` Paul E. McKenney
2018-05-19 22:59   ` Joel Fernandes
2018-05-20  0:49     ` Paul E. McKenney
2018-05-20  0:56       ` Joel Fernandes
2018-05-20 15:28       ` Steven Rostedt
2018-05-20 19:18         ` Joel Fernandes
2018-05-22  1:59           ` Steven Rostedt
2018-05-22  4:34             ` Joel Fernandes
2018-05-22  4:54             ` Joel Fernandes
2018-05-22 12:38               ` Steven Rostedt
2018-05-22 16:09                 ` Paul E. McKenney [this message]
2018-05-22 17:27                   ` Steven Rostedt
2018-05-22 17:47                     ` Paul E. McKenney
2018-05-23  1:19                       ` Joel Fernandes
2018-05-23  3:10                 ` Joel Fernandes

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=20180522160949.GU3803@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=byungchul.park@lge.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --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