All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
@ 2013-03-15  0:08 ` Stephen Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2013-03-15  0:08 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel, linux-arm-msm, linux-arm-kernel

cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
is called by cyc_to_sched_clock(). I suspect that some compilers
inline both of these functions into sched_clock() and so we've
been getting away without having a notrace marking. It seems that
my compiler isn't inlining cyc_to_sched_clock() though, so I'm
hitting a recursion bug when I enable the function graph tracer,
causing my system to crash. Marking these functions notrace fixes
it. Technically cyc_to_ns() doesn't need the notrace because it's
already marked inline, but let's just add it so that if we ever
remove inline from that function it doesn't blow up.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 arch/arm/kernel/sched_clock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
index bd6f56b..59d2adb 100644
--- a/arch/arm/kernel/sched_clock.c
+++ b/arch/arm/kernel/sched_clock.c
@@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
 
 static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
 
-static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
+static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
 {
 	return (cyc * mult) >> shift;
 }
 
-static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
+static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
 {
 	u64 epoch_ns;
 	u32 epoch_cyc;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

* [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
@ 2013-03-15  0:08 ` Stephen Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2013-03-15  0:08 UTC (permalink / raw)
  To: linux-arm-kernel

cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
is called by cyc_to_sched_clock(). I suspect that some compilers
inline both of these functions into sched_clock() and so we've
been getting away without having a notrace marking. It seems that
my compiler isn't inlining cyc_to_sched_clock() though, so I'm
hitting a recursion bug when I enable the function graph tracer,
causing my system to crash. Marking these functions notrace fixes
it. Technically cyc_to_ns() doesn't need the notrace because it's
already marked inline, but let's just add it so that if we ever
remove inline from that function it doesn't blow up.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 arch/arm/kernel/sched_clock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
index bd6f56b..59d2adb 100644
--- a/arch/arm/kernel/sched_clock.c
+++ b/arch/arm/kernel/sched_clock.c
@@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
 
 static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
 
-static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
+static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
 {
 	return (cyc * mult) >> shift;
 }
 
-static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
+static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
 {
 	u64 epoch_ns;
 	u32 epoch_cyc;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

* Re: [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
  2013-03-15  0:08 ` Stephen Boyd
@ 2013-03-21 17:49   ` Stephen Boyd
  -1 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2013-03-21 17:49 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel, linux-arm-msm, linux-arm-kernel

On 03/14/13 17:08, Stephen Boyd wrote:
> cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
> is called by cyc_to_sched_clock(). I suspect that some compilers
> inline both of these functions into sched_clock() and so we've
> been getting away without having a notrace marking. It seems that
> my compiler isn't inlining cyc_to_sched_clock() though, so I'm
> hitting a recursion bug when I enable the function graph tracer,
> causing my system to crash. Marking these functions notrace fixes
> it. Technically cyc_to_ns() doesn't need the notrace because it's
> already marked inline, but let's just add it so that if we ever
> remove inline from that function it doesn't blow up.

Anyone else seeing this problem?

>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>  arch/arm/kernel/sched_clock.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
> index bd6f56b..59d2adb 100644
> --- a/arch/arm/kernel/sched_clock.c
> +++ b/arch/arm/kernel/sched_clock.c
> @@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
>  
>  static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
>  
> -static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
> +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>  {
>  	return (cyc * mult) >> shift;
>  }
>  
> -static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
> +static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
>  {
>  	u64 epoch_ns;
>  	u32 epoch_cyc;

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
@ 2013-03-21 17:49   ` Stephen Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2013-03-21 17:49 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/14/13 17:08, Stephen Boyd wrote:
> cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
> is called by cyc_to_sched_clock(). I suspect that some compilers
> inline both of these functions into sched_clock() and so we've
> been getting away without having a notrace marking. It seems that
> my compiler isn't inlining cyc_to_sched_clock() though, so I'm
> hitting a recursion bug when I enable the function graph tracer,
> causing my system to crash. Marking these functions notrace fixes
> it. Technically cyc_to_ns() doesn't need the notrace because it's
> already marked inline, but let's just add it so that if we ever
> remove inline from that function it doesn't blow up.

Anyone else seeing this problem?

>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>  arch/arm/kernel/sched_clock.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
> index bd6f56b..59d2adb 100644
> --- a/arch/arm/kernel/sched_clock.c
> +++ b/arch/arm/kernel/sched_clock.c
> @@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
>  
>  static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
>  
> -static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
> +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>  {
>  	return (cyc * mult) >> shift;
>  }
>  
> -static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
> +static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
>  {
>  	u64 epoch_ns;
>  	u32 epoch_cyc;

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* Re: [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
  2013-03-21 17:49   ` Stephen Boyd
@ 2013-03-26 17:35     ` Stephen Boyd
  -1 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2013-03-26 17:35 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel, linux-arm-msm, linux-arm-kernel

On 03/21/13 10:49, Stephen Boyd wrote:
> On 03/14/13 17:08, Stephen Boyd wrote:
>> cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
>> is called by cyc_to_sched_clock(). I suspect that some compilers
>> inline both of these functions into sched_clock() and so we've
>> been getting away without having a notrace marking. It seems that
>> my compiler isn't inlining cyc_to_sched_clock() though, so I'm
>> hitting a recursion bug when I enable the function graph tracer,
>> causing my system to crash. Marking these functions notrace fixes
>> it. Technically cyc_to_ns() doesn't need the notrace because it's
>> already marked inline, but let's just add it so that if we ever
>> remove inline from that function it doesn't blow up.
> Anyone else seeing this problem?

Russell, should I put this into the patch tracker?

>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>> ---
>>  arch/arm/kernel/sched_clock.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
>> index bd6f56b..59d2adb 100644
>> --- a/arch/arm/kernel/sched_clock.c
>> +++ b/arch/arm/kernel/sched_clock.c
>> @@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
>>  
>>  static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
>>  
>> -static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>> +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>>  {
>>  	return (cyc * mult) >> shift;
>>  }
>>  
>> -static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
>> +static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
>>  {
>>  	u64 epoch_ns;
>>  	u32 epoch_cyc;


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
@ 2013-03-26 17:35     ` Stephen Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2013-03-26 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/21/13 10:49, Stephen Boyd wrote:
> On 03/14/13 17:08, Stephen Boyd wrote:
>> cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
>> is called by cyc_to_sched_clock(). I suspect that some compilers
>> inline both of these functions into sched_clock() and so we've
>> been getting away without having a notrace marking. It seems that
>> my compiler isn't inlining cyc_to_sched_clock() though, so I'm
>> hitting a recursion bug when I enable the function graph tracer,
>> causing my system to crash. Marking these functions notrace fixes
>> it. Technically cyc_to_ns() doesn't need the notrace because it's
>> already marked inline, but let's just add it so that if we ever
>> remove inline from that function it doesn't blow up.
> Anyone else seeing this problem?

Russell, should I put this into the patch tracker?

>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>> ---
>>  arch/arm/kernel/sched_clock.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
>> index bd6f56b..59d2adb 100644
>> --- a/arch/arm/kernel/sched_clock.c
>> +++ b/arch/arm/kernel/sched_clock.c
>> @@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
>>  
>>  static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
>>  
>> -static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>> +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>>  {
>>  	return (cyc * mult) >> shift;
>>  }
>>  
>> -static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
>> +static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
>>  {
>>  	u64 epoch_ns;
>>  	u32 epoch_cyc;


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* Re: [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
  2013-03-26 17:35     ` Stephen Boyd
@ 2013-04-18  0:34       ` Stephen Boyd
  -1 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2013-04-18  0:34 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel, linux-arm-msm, linux-arm-kernel

On 03/26/13 10:35, Stephen Boyd wrote:
> On 03/21/13 10:49, Stephen Boyd wrote:
>> On 03/14/13 17:08, Stephen Boyd wrote:
>>> cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
>>> is called by cyc_to_sched_clock(). I suspect that some compilers
>>> inline both of these functions into sched_clock() and so we've
>>> been getting away without having a notrace marking. It seems that
>>> my compiler isn't inlining cyc_to_sched_clock() though, so I'm
>>> hitting a recursion bug when I enable the function graph tracer,
>>> causing my system to crash. Marking these functions notrace fixes
>>> it. Technically cyc_to_ns() doesn't need the notrace because it's
>>> already marked inline, but let's just add it so that if we ever
>>> remove inline from that function it doesn't blow up.
>> Anyone else seeing this problem?
> Russell, should I put this into the patch tracker?

I'll throw this into the patch tracker tomorrow if nobody complains.

>>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>>> ---
>>>  arch/arm/kernel/sched_clock.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
>>> index bd6f56b..59d2adb 100644
>>> --- a/arch/arm/kernel/sched_clock.c
>>> +++ b/arch/arm/kernel/sched_clock.c
>>> @@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
>>>  
>>>  static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
>>>  
>>> -static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>>> +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>>>  {
>>>  	return (cyc * mult) >> shift;
>>>  }
>>>  
>>> -static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
>>> +static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
>>>  {
>>>  	u64 epoch_ns;
>>>  	u32 epoch_cyc;
>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
@ 2013-04-18  0:34       ` Stephen Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2013-04-18  0:34 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/26/13 10:35, Stephen Boyd wrote:
> On 03/21/13 10:49, Stephen Boyd wrote:
>> On 03/14/13 17:08, Stephen Boyd wrote:
>>> cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
>>> is called by cyc_to_sched_clock(). I suspect that some compilers
>>> inline both of these functions into sched_clock() and so we've
>>> been getting away without having a notrace marking. It seems that
>>> my compiler isn't inlining cyc_to_sched_clock() though, so I'm
>>> hitting a recursion bug when I enable the function graph tracer,
>>> causing my system to crash. Marking these functions notrace fixes
>>> it. Technically cyc_to_ns() doesn't need the notrace because it's
>>> already marked inline, but let's just add it so that if we ever
>>> remove inline from that function it doesn't blow up.
>> Anyone else seeing this problem?
> Russell, should I put this into the patch tracker?

I'll throw this into the patch tracker tomorrow if nobody complains.

>>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>>> ---
>>>  arch/arm/kernel/sched_clock.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
>>> index bd6f56b..59d2adb 100644
>>> --- a/arch/arm/kernel/sched_clock.c
>>> +++ b/arch/arm/kernel/sched_clock.c
>>> @@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
>>>  
>>>  static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
>>>  
>>> -static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>>> +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
>>>  {
>>>  	return (cyc * mult) >> shift;
>>>  }
>>>  
>>> -static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
>>> +static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
>>>  {
>>>  	u64 epoch_ns;
>>>  	u32 epoch_cyc;
>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* Re: [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
  2013-04-18  0:34       ` Stephen Boyd
@ 2013-04-18  9:20         ` Russell King - ARM Linux
  -1 siblings, 0 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2013-04-18  9:20 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: linux-kernel, linux-arm-msm, linux-arm-kernel

On Wed, Apr 17, 2013 at 05:34:45PM -0700, Stephen Boyd wrote:
> On 03/26/13 10:35, Stephen Boyd wrote:
> > On 03/21/13 10:49, Stephen Boyd wrote:
> >> On 03/14/13 17:08, Stephen Boyd wrote:
> >>> cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
> >>> is called by cyc_to_sched_clock(). I suspect that some compilers
> >>> inline both of these functions into sched_clock() and so we've
> >>> been getting away without having a notrace marking. It seems that
> >>> my compiler isn't inlining cyc_to_sched_clock() though, so I'm
> >>> hitting a recursion bug when I enable the function graph tracer,
> >>> causing my system to crash. Marking these functions notrace fixes
> >>> it. Technically cyc_to_ns() doesn't need the notrace because it's
> >>> already marked inline, but let's just add it so that if we ever
> >>> remove inline from that function it doesn't blow up.
> >> Anyone else seeing this problem?
> > Russell, should I put this into the patch tracker?
> 
> I'll throw this into the patch tracker tomorrow if nobody complains.

Or you could do so today.

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

* [PATCH] ARM: sched_clock: Add more notrace to prevent recursion
@ 2013-04-18  9:20         ` Russell King - ARM Linux
  0 siblings, 0 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2013-04-18  9:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 17, 2013 at 05:34:45PM -0700, Stephen Boyd wrote:
> On 03/26/13 10:35, Stephen Boyd wrote:
> > On 03/21/13 10:49, Stephen Boyd wrote:
> >> On 03/14/13 17:08, Stephen Boyd wrote:
> >>> cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns()
> >>> is called by cyc_to_sched_clock(). I suspect that some compilers
> >>> inline both of these functions into sched_clock() and so we've
> >>> been getting away without having a notrace marking. It seems that
> >>> my compiler isn't inlining cyc_to_sched_clock() though, so I'm
> >>> hitting a recursion bug when I enable the function graph tracer,
> >>> causing my system to crash. Marking these functions notrace fixes
> >>> it. Technically cyc_to_ns() doesn't need the notrace because it's
> >>> already marked inline, but let's just add it so that if we ever
> >>> remove inline from that function it doesn't blow up.
> >> Anyone else seeing this problem?
> > Russell, should I put this into the patch tracker?
> 
> I'll throw this into the patch tracker tomorrow if nobody complains.

Or you could do so today.

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

end of thread, other threads:[~2013-04-18  9:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-15  0:08 [PATCH] ARM: sched_clock: Add more notrace to prevent recursion Stephen Boyd
2013-03-15  0:08 ` Stephen Boyd
2013-03-21 17:49 ` Stephen Boyd
2013-03-21 17:49   ` Stephen Boyd
2013-03-26 17:35   ` Stephen Boyd
2013-03-26 17:35     ` Stephen Boyd
2013-04-18  0:34     ` Stephen Boyd
2013-04-18  0:34       ` Stephen Boyd
2013-04-18  9:20       ` Russell King - ARM Linux
2013-04-18  9:20         ` Russell King - ARM Linux

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.