mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, kernel-team@android.com,
	Boqun Feng <boqun.feng@gmail.com>,
	Byungchul Park <byungchul.park@lge.com>,
	Erick Reyes <erickreyes@google.com>,
	Ingo Molnar <mingo@redhat.com>, Julia Cartwright <julia@ni.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Paul McKenney <paulmck@linux.vnet.ibm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Glexiner <tglx@linutronix.de>,
	Todd Kjos <tkjos@google.com>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH v10 2/3] tracepoint: Make rcuidle tracepoint callers use SRCU
Date: Tue, 17 Jul 2018 17:16:25 -0700	[thread overview]
Message-ID: <20180718001625.GA154046@joelaf.mtv.corp.google.com> (raw)
In-Reply-To: <20180717182528.GK2494@hirez.programming.kicks-ass.net>

On Tue, Jul 17, 2018 at 08:25:28PM +0200, Peter Zijlstra wrote:
> On Fri, Jul 13, 2018 at 02:55:46PM -0700, Joel Fernandes wrote:
> > +		/* keep srcu and sched-rcu usage consistent */		\
> > +		preempt_disable_notrace();				\
> > +									\
> > +		/*							\
> > +		 * For rcuidle callers, use srcu since sched-rcu	\
> > +		 * doesn't work from the idle path.			\
> > +		 */							\
> > +		if (rcuidle)						\
> > +			idx = srcu_read_lock_notrace(&tracepoint_srcu);	\
> > +		else							\
> > +			rcu_read_lock_sched_notrace();			\
> 
> That else is completely superfluous. rcu_read_lock_sched_notrace() :=
> prempt_disable_notrace().

I have a patch as below on top of this series. Thanks for the suggestion.

Steve, Peter,

Is it Ok with you to take the below patch ontop of this series? I avoided
resending the 3-patch series since this is the only change, but let me know
what you prefer or makes it easy for you.

------->8--------

From: Joel Fernandes <joelaf@google.com>
Subject: [PATCH] tracepoint: Remove extra unneeded rcu_read_lock_sched_notrace

A great idea was provided that rcu_read_lock_sched_notrace being the
equivalent of preempt_disable_notrace is unnecessary to call in
tracepoint code, since we already call preempt_disable_notrace in
advance. So lets remove the extra call.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Joel Fernandes <joelaf@google.com>
---
 include/linux/tracepoint.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 97e1d365a817..6e7bc6ebfcd8 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -161,8 +161,6 @@ extern void syscall_unregfunc(void);
 		 */							\
 		if (rcuidle)						\
 			idx = srcu_read_lock_notrace(&tracepoint_srcu);	\
-		else							\
-			rcu_read_lock_sched_notrace();			\
 									\
 		it_func_ptr = rcu_dereference_raw((tp)->funcs);		\
 									\
@@ -176,8 +174,6 @@ extern void syscall_unregfunc(void);
 									\
 		if (rcuidle)						\
 			srcu_read_unlock_notrace(&tracepoint_srcu, idx);\
-		else							\
-			rcu_read_unlock_sched_notrace();		\
 									\
 		preempt_enable_notrace();				\
 	} while (0)
-- 
2.18.0.203.gfac676dfb9-goog


  parent reply	other threads:[~2018-07-18  0:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 21:55 [PATCH v10 0/3] tracing: Centralize preemptirq tracepoints and unify their usage Joel Fernandes
2018-07-13 21:55 ` [PATCH v10 1/3] lockdep: use this_cpu_ptr instead of get_cpu_var stats Joel Fernandes
2018-07-13 21:55 ` [PATCH v10 2/3] tracepoint: Make rcuidle tracepoint callers use SRCU Joel Fernandes
2018-07-14 14:31   ` Mathieu Desnoyers
2018-07-17 17:11     ` Joel Fernandes
2018-07-17 18:25   ` Peter Zijlstra
2018-07-17 20:15     ` Joel Fernandes
2018-07-18  0:16     ` Joel Fernandes [this message]
2018-07-18  8:21       ` Peter Zijlstra
2018-07-26 23:18       ` Steven Rostedt
2018-07-26 23:35         ` Joel Fernandes
2018-07-13 21:55 ` [PATCH v10 3/3] tracing: Centralize preemptirq tracepoints and unify their usage 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=20180718001625.GA154046@joelaf.mtv.corp.google.com \
    --to=joel@joelfernandes.org \
    --cc=boqun.feng@gmail.com \
    --cc=byungchul.park@lge.com \
    --cc=erickreyes@google.com \
    --cc=julia@ni.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tkjos@google.com \
    --cc=tom.zanussi@linux.intel.com \
    --cc=will.deacon@arm.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®