linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chunyan Zhang <zhang.chunyan@linaro.org>
To: arnd@arndb.de
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhang.lyra@gmail.com
Subject: [PATCH] percpu: make this_cpu_generic_read notrace
Date: Sat, 10 Sep 2016 16:45:34 +0800	[thread overview]
Message-ID: <1473497134-27807-1-git-send-email-zhang.chunyan@linaro.org> (raw)

When debug preempt or preempt tracer is enabled, preempt_count_add/sub()
can be traced by function and function graph tracing, and
preempt_disable/enable() would call preempt_count_add/sub(), so
we should use preempt_disable/enable_notrace in Ftrace subsystem.

The function this_cpu_read() started being used by function graph tracing
after the commit 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the
bitmap like events do"), so it has to use preempt_disable/enable_notrace
instead now.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
 include/asm-generic/percpu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 4d9f233..70fefec 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -108,9 +108,9 @@ do {									\
 #define this_cpu_generic_read(pcp)					\
 ({									\
 	typeof(pcp) __ret;						\
-	preempt_disable();						\
+	preempt_disable_notrace();					\
 	__ret = *this_cpu_ptr(&(pcp));					\
-	preempt_enable();						\
+	preempt_enable_notrace();					\
 	__ret;								\
 })
 
-- 
2.7.4

             reply	other threads:[~2016-09-10  8:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-10  8:45 Chunyan Zhang [this message]
2016-09-16  8:42 ` [PATCH] percpu: make this_cpu_generic_read notrace Chunyan Zhang
2016-09-16  9:53   ` Will Deacon
2016-09-16 10:08     ` Chunyan Zhang
2016-09-16 13:19     ` Steven Rostedt
2016-09-24  9:18     ` Arnd Bergmann
2016-09-24  9:18       ` Arnd Bergmann

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=1473497134-27807-1-git-send-email-zhang.chunyan@linaro.org \
    --to=zhang.chunyan@linaro.org \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhang.lyra@gmail.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;
as well as URLs for NNTP newsgroup(s).