linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] percpu: make this_cpu_generic_read notrace
@ 2016-09-10  8:45 Chunyan Zhang
  2016-09-16  8:42 ` Chunyan Zhang
  0 siblings, 1 reply; 6+ messages in thread
From: Chunyan Zhang @ 2016-09-10  8:45 UTC (permalink / raw)
  To: arnd; +Cc: linux-arch, linux-kernel, zhang.lyra

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] percpu: make this_cpu_generic_read notrace
  2016-09-10  8:45 [PATCH] percpu: make this_cpu_generic_read notrace Chunyan Zhang
@ 2016-09-16  8:42 ` Chunyan Zhang
  2016-09-16  9:53   ` Will Deacon
  0 siblings, 1 reply; 6+ messages in thread
From: Chunyan Zhang @ 2016-09-16  8:42 UTC (permalink / raw)
  To: Arnd Bergmann, Will Deacon, Steven Rostedt
  Cc: linux-arch, linux-kernel, Lyra Zhang

Hi Will and Steven,

May I have a review or an acked-by from you on this patch so that Arnd
can pick it up.

I have tested this patch on arm qemu, I'm sure it can solve the
problem described in commit message.


Thanks,
Chunyan


On 10 September 2016 at 16:45, Chunyan Zhang <zhang.chunyan@linaro.org> wrote:
> 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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] percpu: make this_cpu_generic_read notrace
  2016-09-16  8:42 ` Chunyan Zhang
@ 2016-09-16  9:53   ` Will Deacon
  2016-09-16 10:08     ` Chunyan Zhang
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Will Deacon @ 2016-09-16  9:53 UTC (permalink / raw)
  To: Chunyan Zhang
  Cc: Arnd Bergmann, Steven Rostedt, linux-arch, linux-kernel, Lyra Zhang

On Fri, Sep 16, 2016 at 04:42:44PM +0800, Chunyan Zhang wrote:
> Hi Will and Steven,
> 
> May I have a review or an acked-by from you on this patch so that Arnd
> can pick it up.
> 
> I have tested this patch on arm qemu, I'm sure it can solve the
> problem described in commit message.

It looks fine to me; we took your equivalent patch for arm64 already, so:

Acked-by: Will Deacon <will.deacon@arm.com>

Will

> On 10 September 2016 at 16:45, Chunyan Zhang <zhang.chunyan@linaro.org> wrote:
> > 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
> >
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] percpu: make this_cpu_generic_read notrace
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Chunyan Zhang @ 2016-09-16 10:08 UTC (permalink / raw)
  To: Will Deacon
  Cc: Arnd Bergmann, Steven Rostedt, linux-arch, linux-kernel, Lyra Zhang

On 16 September 2016 at 17:53, Will Deacon <will.deacon@arm.com> wrote:
> On Fri, Sep 16, 2016 at 04:42:44PM +0800, Chunyan Zhang wrote:
>> Hi Will and Steven,
>>
>> May I have a review or an acked-by from you on this patch so that Arnd
>> can pick it up.
>>
>> I have tested this patch on arm qemu, I'm sure it can solve the
>> problem described in commit message.
>
> It looks fine to me; we took your equivalent patch for arm64 already, so:

Yeah, I saw that.

>
> Acked-by: Will Deacon <will.deacon@arm.com>

Thanks,
Chunyan

>
> Will
>
>> On 10 September 2016 at 16:45, Chunyan Zhang <zhang.chunyan@linaro.org> wrote:
>> > 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
>> >
>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] percpu: make this_cpu_generic_read notrace
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2016-09-16 13:19 UTC (permalink / raw)
  To: Will Deacon
  Cc: Chunyan Zhang, Arnd Bergmann, linux-arch, linux-kernel, Lyra Zhang

On Fri, 16 Sep 2016 10:53:09 +0100
Will Deacon <will.deacon@arm.com> wrote:

> On Fri, Sep 16, 2016 at 04:42:44PM +0800, Chunyan Zhang wrote:
> > Hi Will and Steven,
> > 
> > May I have a review or an acked-by from you on this patch so that Arnd
> > can pick it up.
> > 
> > I have tested this patch on arm qemu, I'm sure it can solve the
> > problem described in commit message.  
> 
> It looks fine to me; we took your equivalent patch for arm64 already, so:
> 

Looks good to me too.

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] percpu: make this_cpu_generic_read notrace
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-09-24  9:18 UTC (permalink / raw)
  To: Will Deacon
  Cc: Chunyan Zhang, Steven Rostedt, linux-arch, linux-kernel, Lyra Zhang

On Friday, September 16, 2016 10:53:09 AM CEST Will Deacon wrote:
> On Fri, Sep 16, 2016 at 04:42:44PM +0800, Chunyan Zhang wrote:
> > Hi Will and Steven,
> > 
> > May I have a review or an acked-by from you on this patch so that Arnd
> > can pick it up.
> > 
> > I have tested this patch on arm qemu, I'm sure it can solve the
> > problem described in commit message.
> 
> It looks fine to me; we took your equivalent patch for arm64 already, so:
> 
> Acked-by: Will Deacon <will.deacon@arm.com>
> 

Applied to my asm-generic tree now, sorry for the delay,

	Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-24  9:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-10  8:45 [PATCH] percpu: make this_cpu_generic_read notrace Chunyan Zhang
2016-09-16  8:42 ` 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

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).