From: Steven Rostedt <rostedt@goodmis.org>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
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: Sun, 20 May 2018 11:28:43 -0400 [thread overview]
Message-ID: <20180520112843.57079857@grimm.local.home> (raw)
In-Reply-To: <20180520004938.GZ3803@linux.vnet.ibm.com>
[ Steve interrupts his time off ]
On Sat, 19 May 2018 17:49:38 -0700
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> I suggested to Steven that the rcu_read_lock() and rcu_read_unlock() might
> be outside of the trampoline, but this turned out to be infeasible. Not
> that I remember why! ;-)
Because the trampoline itself is what needs to be freed. The trampoline
is what mcount/fentry or an optimized kprobe jumps to.
<func>:
nop
[ enable function tracing ]
<func>:
call func_tramp --> set up stack
call function_tracer()
pop stack
ret
^^^^^
This is the trampoline
There's no way to know when a task will be on the trampoline or not.
The trampoline is allocated, and we need RCU_tasks to know when we can
free it. The only way to make a "wrapper" is to modify more of the code
text to do whatever before calling the trampoline, which is
impractical.
The allocated trampolines were added as an optimization, where two
registered callback functions from ftrace that are attached to two
different functions don't call the same trampoline which would have to
do a loop and a hash lookup to know what callback to call per function.
If a callback is the only one attached to a specific function, then a
trampoline is allocated and will call that callback directly, keeping
the overhead down.
There is no feasible way to know when a task is on a trampoline
without adding overhead that negates the speed up we receive by making
individual trampolines to begin with.
-- Steve
[ Steve resumes his time off ]
next prev parent reply other threads:[~2018-05-20 15:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 18:36 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 [this message]
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
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=20180520112843.57079857@grimm.local.home \
--to=rostedt@goodmis.org \
--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=paulmck@linux.vnet.ibm.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
all inboxes | Powered by JetHome®