All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: rostedt <rostedt@goodmis.org>, paulmck <paulmck@kernel.org>,
	Michael Jeanson <mjeanson@efficios.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Yafang Shao <laoar.shao@gmail.com>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Michel Lespinasse <walken@google.com>,
	Daniel Jordan <daniel.m.jordan@oracle.com>,
	Davidlohr Bueso <dbueso@suse.de>, linux-mm <linux-mm@kvack.org>,
	Ingo Molnar <mingo@kernel.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header
Date: Fri, 25 Sep 2020 10:41:56 -0400 (EDT)	[thread overview]
Message-ID: <176393901.69671.1601044916547.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20200924163331.0080b943@oasis.local.home>

----- On Sep 24, 2020, at 4:33 PM, rostedt rostedt@goodmis.org wrote:

> On Thu, 24 Sep 2020 16:27:34 -0400 (EDT)
> Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> 
>> I'd be a bit more specific: so far, the msr.h use-case requires to include
>> directly tracepoint-defs.h and use a tracepoint_enabled() macro defined there.
>> 
>> Other less "core" header use-cases could still include tracepoint.h, as long as
>> there is no circular dependency.
> 
> Well, I'll keep tracepoint-defs.h for the msr.h case, and I could see
> if tracepoint.h is good enough for the other cases.
> 
> But does it really matter, if we only need what is in
> tracepoint-defs.h?  Why add something that may cause issues in the
> future?

The trade-off here is tracing (on) speed and code size vs header instrumentation
coverage.

Adding the trampoline as is done in msr.h adds the overhead of an extra
function call when tracing is active. It also slightly increases the code
size. This is why we don't have that extra trampoline in the common case.

The main limitation with respect to tracepoint instrumentation coverage is
header dependencies of RCU read-side synchronization. Currently, tracepoint.h
uses rcu-sched and SRCU. Moving that synchronization into a trampoline
is one way to work-around circular dependency issues.

Note that I have plans to make tracepoint.h use Tasks Trace RCU as well,
so some probes can take pages faults (especially useful for sys enter/exit).
Michael Jeanson has been working on a prototype implementing this, and
he should be able to post a RFC patch publicly soon.

That being said, I suspect that Tasks Trace RCU has fewer header dependencies
than rcu-sched and SRCU. Maybe one idea worth considering is replacing
tracepoint's use of rcu-sched and SRCU by Tasks Trace RCU altogether, if the
latter has read-side performance close to rcu-sched. This could be another way
to minimize the amount of tracepoint.h header dependencies.

With the current dependencies of tracepoint.h, I would argue that we should
only do the trampoline work-around for cases where there is an unavoidable
circular dependency, like the case of msr.h. For other headers which don't
have circular dependency issues with tracepoint.h, we should use the usual
tracepoint instrumentation because not having the trampoline provides better
tracing (on) speed and reduces (slightly) code size.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2020-09-25 14:42 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24 17:09 [PATCH 0/2] tracing/mm: Add tracepoint_enabled() helper function for headers Steven Rostedt
2020-09-24 17:09 ` [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header Steven Rostedt
2020-09-24 17:42   ` Mathieu Desnoyers
2020-09-24 17:42     ` Mathieu Desnoyers
2020-09-24 18:19     ` Axel Rasmussen
2020-09-24 18:19       ` Axel Rasmussen
2020-09-24 18:27       ` Mathieu Desnoyers
2020-09-24 18:27         ` Mathieu Desnoyers
2020-09-24 18:30     ` Steven Rostedt
2020-09-24 19:08       ` Mathieu Desnoyers
2020-09-24 19:08         ` Mathieu Desnoyers
2020-09-24 19:35         ` Steven Rostedt
2020-09-24 19:40           ` Steven Rostedt
2020-09-24 20:25             ` Mathieu Desnoyers
2020-09-24 20:25               ` Mathieu Desnoyers
2020-09-24 20:05           ` Mathieu Desnoyers
2020-09-24 20:05             ` Mathieu Desnoyers
2020-09-24 20:13             ` Steven Rostedt
2020-09-24 20:27               ` Mathieu Desnoyers
2020-09-24 20:27                 ` Mathieu Desnoyers
2020-09-24 20:33                 ` Steven Rostedt
2020-09-25 14:41                   ` Mathieu Desnoyers [this message]
2020-09-25 14:41                     ` Mathieu Desnoyers
2020-09-25 15:14                     ` Steven Rostedt
2020-09-25 15:30                       ` Mathieu Desnoyers
2020-09-25 15:30                         ` Mathieu Desnoyers
2020-09-25 16:26                         ` Steven Rostedt
2020-09-25 17:05                           ` Mathieu Desnoyers
2020-09-25 17:05                             ` Mathieu Desnoyers
2020-09-24 20:04         ` Axel Rasmussen
2020-09-24 20:04           ` Axel Rasmussen
2020-09-24 17:09 ` [PATCH 2/2] mm/page_ref: Convert the open coded tracepoint enabled to the new helper Steven Rostedt

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=176393901.69671.1601044916547.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=daniel.m.jordan@oracle.com \
    --cc=dbueso@suse.de \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=mjeanson@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=vbabka@suse.cz \
    --cc=walken@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.