[PATCH 1/4] cputime/powerpc: Remove cputime_last_delta global variable

2016-11-14 Thread Frederic Weisbecker
From: Stanislaw Gruszka 

Since commit:

cf9efce0ce313 ("powerpc: Account time using timebase rather than PURR")

cputime_last_delta is not initialized to other value than 0, hence it's
not used except zero check and cputime_to_scaled() just returns
the argument.

Acked-by: Paul Mackerras 
Signed-off-by: Stanislaw Gruszka 
Cc: Ingo Molnar 
Cc: Peter Zijlstra 
Cc: Paul Mackerras 
Cc: Benjamin Herrenschmidt 
Cc: Michael Neuling 
Cc: Martin Schwidefsky 
Cc: Heiko Carstens 
Link: 
http://lkml.kernel.org/r/1477917389-11341-2-git-send-email-sgrus...@redhat.com
Signed-off-by: Frederic Weisbecker 
---
 arch/powerpc/include/asm/cputime.h | 7 ---
 arch/powerpc/kernel/time.c | 2 --
 2 files changed, 9 deletions(-)

diff --git a/arch/powerpc/include/asm/cputime.h 
b/arch/powerpc/include/asm/cputime.h
index 4f60db0..9f5dcf7 100644
--- a/arch/powerpc/include/asm/cputime.h
+++ b/arch/powerpc/include/asm/cputime.h
@@ -46,8 +46,6 @@ extern cputime_t cputime_one_jiffy;
  * Convert cputime <-> jiffies
  */
 extern u64 __cputime_jiffies_factor;
-DECLARE_PER_CPU(unsigned long, cputime_last_delta);
-DECLARE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 static inline unsigned long cputime_to_jiffies(const cputime_t ct)
 {
@@ -58,11 +56,6 @@ static inline unsigned long cputime_to_jiffies(const 
cputime_t ct)
  * the last scaled to real ratio */
 static inline cputime_t cputime_to_scaled(const cputime_t ct)
 {
-   if (cpu_has_feature(CPU_FTR_SPURR) &&
-   __this_cpu_read(cputime_last_delta))
-   return (__force u64) ct *
-   __this_cpu_read(cputime_scaled_last_delta) /
-   __this_cpu_read(cputime_last_delta);
return ct;
 }
 
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index bc3f7d0..8105198 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -164,8 +164,6 @@ u64 __cputime_sec_factor;
 EXPORT_SYMBOL(__cputime_sec_factor);
 u64 __cputime_clockt_factor;
 EXPORT_SYMBOL(__cputime_clockt_factor);
-DEFINE_PER_CPU(unsigned long, cputime_last_delta);
-DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 cputime_t cputime_one_jiffy;
 
-- 
2.7.4



[PATCH 1/4] cputime/powerpc: Remove cputime_last_delta global variable

2016-11-14 Thread Frederic Weisbecker
From: Stanislaw Gruszka 

Since commit:

cf9efce0ce313 ("powerpc: Account time using timebase rather than PURR")

cputime_last_delta is not initialized to other value than 0, hence it's
not used except zero check and cputime_to_scaled() just returns
the argument.

Acked-by: Paul Mackerras 
Signed-off-by: Stanislaw Gruszka 
Cc: Ingo Molnar 
Cc: Peter Zijlstra 
Cc: Paul Mackerras 
Cc: Benjamin Herrenschmidt 
Cc: Michael Neuling 
Cc: Martin Schwidefsky 
Cc: Heiko Carstens 
Link: 
http://lkml.kernel.org/r/1477917389-11341-2-git-send-email-sgrus...@redhat.com
Signed-off-by: Frederic Weisbecker 
---
 arch/powerpc/include/asm/cputime.h | 7 ---
 arch/powerpc/kernel/time.c | 2 --
 2 files changed, 9 deletions(-)

diff --git a/arch/powerpc/include/asm/cputime.h 
b/arch/powerpc/include/asm/cputime.h
index 4f60db0..9f5dcf7 100644
--- a/arch/powerpc/include/asm/cputime.h
+++ b/arch/powerpc/include/asm/cputime.h
@@ -46,8 +46,6 @@ extern cputime_t cputime_one_jiffy;
  * Convert cputime <-> jiffies
  */
 extern u64 __cputime_jiffies_factor;
-DECLARE_PER_CPU(unsigned long, cputime_last_delta);
-DECLARE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 static inline unsigned long cputime_to_jiffies(const cputime_t ct)
 {
@@ -58,11 +56,6 @@ static inline unsigned long cputime_to_jiffies(const 
cputime_t ct)
  * the last scaled to real ratio */
 static inline cputime_t cputime_to_scaled(const cputime_t ct)
 {
-   if (cpu_has_feature(CPU_FTR_SPURR) &&
-   __this_cpu_read(cputime_last_delta))
-   return (__force u64) ct *
-   __this_cpu_read(cputime_scaled_last_delta) /
-   __this_cpu_read(cputime_last_delta);
return ct;
 }
 
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index bc3f7d0..8105198 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -164,8 +164,6 @@ u64 __cputime_sec_factor;
 EXPORT_SYMBOL(__cputime_sec_factor);
 u64 __cputime_clockt_factor;
 EXPORT_SYMBOL(__cputime_clockt_factor);
-DEFINE_PER_CPU(unsigned long, cputime_last_delta);
-DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 cputime_t cputime_one_jiffy;
 
-- 
2.7.4



Re: [PATCH 1/4] cputime/powerpc: remove cputime_last_delta global variable

2016-11-02 Thread Paul Mackerras
On Mon, Oct 31, 2016 at 01:36:26PM +0100, Stanislaw Gruszka wrote:
> Since commit:
> 
> cf9efce0ce313 ("powerpc: Account time using timebase rather than PURR")
> 
> cputime_last_delta is not initialized to other value than 0, hence it's
> not used except zero check and cputime_to_scaled() just returns
> the argument.
> 
> Signed-off-by: Stanislaw Gruszka 

Yes, I should have removed them in that commit.  We don't want to do
any scaling in the places where cputime_to_scaled() is used.

Acked-by: Paul Mackerras 


Re: [PATCH 1/4] cputime/powerpc: remove cputime_last_delta global variable

2016-11-02 Thread Paul Mackerras
On Mon, Oct 31, 2016 at 01:36:26PM +0100, Stanislaw Gruszka wrote:
> Since commit:
> 
> cf9efce0ce313 ("powerpc: Account time using timebase rather than PURR")
> 
> cputime_last_delta is not initialized to other value than 0, hence it's
> not used except zero check and cputime_to_scaled() just returns
> the argument.
> 
> Signed-off-by: Stanislaw Gruszka 

Yes, I should have removed them in that commit.  We don't want to do
any scaling in the places where cputime_to_scaled() is used.

Acked-by: Paul Mackerras 


[PATCH 1/4] cputime/powerpc: remove cputime_last_delta global variable

2016-10-31 Thread Stanislaw Gruszka
Since commit:

cf9efce0ce313 ("powerpc: Account time using timebase rather than PURR")

cputime_last_delta is not initialized to other value than 0, hence it's
not used except zero check and cputime_to_scaled() just returns
the argument.

Signed-off-by: Stanislaw Gruszka 
---
 arch/powerpc/include/asm/cputime.h |7 ---
 arch/powerpc/kernel/time.c |2 --
 2 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/cputime.h 
b/arch/powerpc/include/asm/cputime.h
index 4f60db0..9f5dcf7 100644
--- a/arch/powerpc/include/asm/cputime.h
+++ b/arch/powerpc/include/asm/cputime.h
@@ -46,8 +46,6 @@ static inline void setup_cputime_one_jiffy(void) { }
  * Convert cputime <-> jiffies
  */
 extern u64 __cputime_jiffies_factor;
-DECLARE_PER_CPU(unsigned long, cputime_last_delta);
-DECLARE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 static inline unsigned long cputime_to_jiffies(const cputime_t ct)
 {
@@ -58,11 +56,6 @@ static inline unsigned long cputime_to_jiffies(const 
cputime_t ct)
  * the last scaled to real ratio */
 static inline cputime_t cputime_to_scaled(const cputime_t ct)
 {
-   if (cpu_has_feature(CPU_FTR_SPURR) &&
-   __this_cpu_read(cputime_last_delta))
-   return (__force u64) ct *
-   __this_cpu_read(cputime_scaled_last_delta) /
-   __this_cpu_read(cputime_last_delta);
return ct;
 }
 
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index bc3f7d0..8105198 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -164,8 +164,6 @@ struct clock_event_device decrementer_clockevent = {
 EXPORT_SYMBOL(__cputime_sec_factor);
 u64 __cputime_clockt_factor;
 EXPORT_SYMBOL(__cputime_clockt_factor);
-DEFINE_PER_CPU(unsigned long, cputime_last_delta);
-DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 cputime_t cputime_one_jiffy;
 
-- 
1.7.1



[PATCH 1/4] cputime/powerpc: remove cputime_last_delta global variable

2016-10-31 Thread Stanislaw Gruszka
Since commit:

cf9efce0ce313 ("powerpc: Account time using timebase rather than PURR")

cputime_last_delta is not initialized to other value than 0, hence it's
not used except zero check and cputime_to_scaled() just returns
the argument.

Signed-off-by: Stanislaw Gruszka 
---
 arch/powerpc/include/asm/cputime.h |7 ---
 arch/powerpc/kernel/time.c |2 --
 2 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/cputime.h 
b/arch/powerpc/include/asm/cputime.h
index 4f60db0..9f5dcf7 100644
--- a/arch/powerpc/include/asm/cputime.h
+++ b/arch/powerpc/include/asm/cputime.h
@@ -46,8 +46,6 @@ static inline void setup_cputime_one_jiffy(void) { }
  * Convert cputime <-> jiffies
  */
 extern u64 __cputime_jiffies_factor;
-DECLARE_PER_CPU(unsigned long, cputime_last_delta);
-DECLARE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 static inline unsigned long cputime_to_jiffies(const cputime_t ct)
 {
@@ -58,11 +56,6 @@ static inline unsigned long cputime_to_jiffies(const 
cputime_t ct)
  * the last scaled to real ratio */
 static inline cputime_t cputime_to_scaled(const cputime_t ct)
 {
-   if (cpu_has_feature(CPU_FTR_SPURR) &&
-   __this_cpu_read(cputime_last_delta))
-   return (__force u64) ct *
-   __this_cpu_read(cputime_scaled_last_delta) /
-   __this_cpu_read(cputime_last_delta);
return ct;
 }
 
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index bc3f7d0..8105198 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -164,8 +164,6 @@ struct clock_event_device decrementer_clockevent = {
 EXPORT_SYMBOL(__cputime_sec_factor);
 u64 __cputime_clockt_factor;
 EXPORT_SYMBOL(__cputime_clockt_factor);
-DEFINE_PER_CPU(unsigned long, cputime_last_delta);
-DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 cputime_t cputime_one_jiffy;
 
-- 
1.7.1