Re: [RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-05-16 Thread Chander Kashyap
On 16 May 2014 15:16, Rafael J. Wysocki  wrote:
> On 5/16/2014 10:16 AM, Chander Kashyap wrote:
>>
>> On 22 April 2014 18:08, Chander Kashyap 
>> wrote:
>>>
>>> In menu_select function we check for correction factor every time.
>>> If it is zero we are initializing to unity. Hence move it to init
>>> function
>>> and initialise by unity, hence avoid repeated comparisons.
>>>
>>> Signed-off-by: Chander Kashyap 
>>> Reviewed-by: Tuukka Tikkanen 
>>> ---
>>>   drivers/cpuidle/governors/menu.c |   15 ---
>>>   1 file changed, 8 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/cpuidle/governors/menu.c
>>> b/drivers/cpuidle/governors/menu.c
>>> index 71b5232..9b7918c 100644
>>> --- a/drivers/cpuidle/governors/menu.c
>>> +++ b/drivers/cpuidle/governors/menu.c
>>> @@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv,
>>> struct cpuidle_device *dev)
>>>  data->bucket = which_bucket(data->next_timer_us);
>>>
>>>  /*
>>> -* if the correction factor is 0 (eg first time init or cpu
>>> hotplug
>>> -* etc), we actually want to start out with a unity factor.
>>> -*/
>>> -   if (data->correction_factor[data->bucket] == 0)
>>> -   data->correction_factor[data->bucket] = RESOLUTION *
>>> DECAY;
>>> -
>>> -   /*
>>>   * Force the result of multiplication to be 64 bits even if both
>>>   * operands are 32 bits.
>>>   * Make sure to round up for half microseconds.
>>> @@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver
>>> *drv,
>>>  struct cpuidle_device *dev)
>>>   {
>>>  struct menu_device *data = _cpu(menu_devices, dev->cpu);
>>> +   int i;
>>>
>>>  memset(data, 0, sizeof(struct menu_device));
>>>
>>> +   /*
>>> +* if the correction factor is 0 (eg first time init or cpu
>>> hotplug
>>> +* etc), we actually want to start out with a unity factor.
>>> +*/
>>> +   for(i = 0; i < BUCKETS; i++)
>>> +   data->correction_factor[i] = RESOLUTION * DECAY;
>>> +
>>>  return 0;
>>>   }
>>>
>> ping.
>
>
> I believe this is in linux-next today, care to check?
>
> Rafael
>

Thanks, Rafael

-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-05-16 Thread Rafael J. Wysocki

On 5/16/2014 10:16 AM, Chander Kashyap wrote:

On 22 April 2014 18:08, Chander Kashyap  wrote:

In menu_select function we check for correction factor every time.
If it is zero we are initializing to unity. Hence move it to init function
and initialise by unity, hence avoid repeated comparisons.

Signed-off-by: Chander Kashyap 
Reviewed-by: Tuukka Tikkanen 
---
  drivers/cpuidle/governors/menu.c |   15 ---
  1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 71b5232..9b7918c 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv, struct 
cpuidle_device *dev)
 data->bucket = which_bucket(data->next_timer_us);

 /*
-* if the correction factor is 0 (eg first time init or cpu hotplug
-* etc), we actually want to start out with a unity factor.
-*/
-   if (data->correction_factor[data->bucket] == 0)
-   data->correction_factor[data->bucket] = RESOLUTION * DECAY;
-
-   /*
  * Force the result of multiplication to be 64 bits even if both
  * operands are 32 bits.
  * Make sure to round up for half microseconds.
@@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
 struct cpuidle_device *dev)
  {
 struct menu_device *data = _cpu(menu_devices, dev->cpu);
+   int i;

 memset(data, 0, sizeof(struct menu_device));

+   /*
+* if the correction factor is 0 (eg first time init or cpu hotplug
+* etc), we actually want to start out with a unity factor.
+*/
+   for(i = 0; i < BUCKETS; i++)
+   data->correction_factor[i] = RESOLUTION * DECAY;
+
 return 0;
  }


ping.


I believe this is in linux-next today, care to check?

Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-05-16 Thread Chander Kashyap
On 22 April 2014 18:08, Chander Kashyap  wrote:
> In menu_select function we check for correction factor every time.
> If it is zero we are initializing to unity. Hence move it to init function
> and initialise by unity, hence avoid repeated comparisons.
>
> Signed-off-by: Chander Kashyap 
> Reviewed-by: Tuukka Tikkanen 
> ---
>  drivers/cpuidle/governors/menu.c |   15 ---
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/cpuidle/governors/menu.c 
> b/drivers/cpuidle/governors/menu.c
> index 71b5232..9b7918c 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv, 
> struct cpuidle_device *dev)
> data->bucket = which_bucket(data->next_timer_us);
>
> /*
> -* if the correction factor is 0 (eg first time init or cpu hotplug
> -* etc), we actually want to start out with a unity factor.
> -*/
> -   if (data->correction_factor[data->bucket] == 0)
> -   data->correction_factor[data->bucket] = RESOLUTION * DECAY;
> -
> -   /*
>  * Force the result of multiplication to be 64 bits even if both
>  * operands are 32 bits.
>  * Make sure to round up for half microseconds.
> @@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
> struct cpuidle_device *dev)
>  {
> struct menu_device *data = _cpu(menu_devices, dev->cpu);
> +   int i;
>
> memset(data, 0, sizeof(struct menu_device));
>
> +   /*
> +* if the correction factor is 0 (eg first time init or cpu hotplug
> +* etc), we actually want to start out with a unity factor.
> +*/
> +   for(i = 0; i < BUCKETS; i++)
> +   data->correction_factor[i] = RESOLUTION * DECAY;
> +
> return 0;
>  }
>

ping.

> --
> 1.7.9.5
>



-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-05-16 Thread Chander Kashyap
On 22 April 2014 18:08, Chander Kashyap chander.kash...@linaro.org wrote:
 In menu_select function we check for correction factor every time.
 If it is zero we are initializing to unity. Hence move it to init function
 and initialise by unity, hence avoid repeated comparisons.

 Signed-off-by: Chander Kashyap chander.kash...@linaro.org
 Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org
 ---
  drivers/cpuidle/governors/menu.c |   15 ---
  1 file changed, 8 insertions(+), 7 deletions(-)

 diff --git a/drivers/cpuidle/governors/menu.c 
 b/drivers/cpuidle/governors/menu.c
 index 71b5232..9b7918c 100644
 --- a/drivers/cpuidle/governors/menu.c
 +++ b/drivers/cpuidle/governors/menu.c
 @@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv, 
 struct cpuidle_device *dev)
 data-bucket = which_bucket(data-next_timer_us);

 /*
 -* if the correction factor is 0 (eg first time init or cpu hotplug
 -* etc), we actually want to start out with a unity factor.
 -*/
 -   if (data-correction_factor[data-bucket] == 0)
 -   data-correction_factor[data-bucket] = RESOLUTION * DECAY;
 -
 -   /*
  * Force the result of multiplication to be 64 bits even if both
  * operands are 32 bits.
  * Make sure to round up for half microseconds.
 @@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
 struct cpuidle_device *dev)
  {
 struct menu_device *data = per_cpu(menu_devices, dev-cpu);
 +   int i;

 memset(data, 0, sizeof(struct menu_device));

 +   /*
 +* if the correction factor is 0 (eg first time init or cpu hotplug
 +* etc), we actually want to start out with a unity factor.
 +*/
 +   for(i = 0; i  BUCKETS; i++)
 +   data-correction_factor[i] = RESOLUTION * DECAY;
 +
 return 0;
  }


ping.

 --
 1.7.9.5




-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-05-16 Thread Rafael J. Wysocki

On 5/16/2014 10:16 AM, Chander Kashyap wrote:

On 22 April 2014 18:08, Chander Kashyap chander.kash...@linaro.org wrote:

In menu_select function we check for correction factor every time.
If it is zero we are initializing to unity. Hence move it to init function
and initialise by unity, hence avoid repeated comparisons.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org
---
  drivers/cpuidle/governors/menu.c |   15 ---
  1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 71b5232..9b7918c 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv, struct 
cpuidle_device *dev)
 data-bucket = which_bucket(data-next_timer_us);

 /*
-* if the correction factor is 0 (eg first time init or cpu hotplug
-* etc), we actually want to start out with a unity factor.
-*/
-   if (data-correction_factor[data-bucket] == 0)
-   data-correction_factor[data-bucket] = RESOLUTION * DECAY;
-
-   /*
  * Force the result of multiplication to be 64 bits even if both
  * operands are 32 bits.
  * Make sure to round up for half microseconds.
@@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
 struct cpuidle_device *dev)
  {
 struct menu_device *data = per_cpu(menu_devices, dev-cpu);
+   int i;

 memset(data, 0, sizeof(struct menu_device));

+   /*
+* if the correction factor is 0 (eg first time init or cpu hotplug
+* etc), we actually want to start out with a unity factor.
+*/
+   for(i = 0; i  BUCKETS; i++)
+   data-correction_factor[i] = RESOLUTION * DECAY;
+
 return 0;
  }


ping.


I believe this is in linux-next today, care to check?

Rafael

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-05-16 Thread Chander Kashyap
On 16 May 2014 15:16, Rafael J. Wysocki rafael.j.wyso...@intel.com wrote:
 On 5/16/2014 10:16 AM, Chander Kashyap wrote:

 On 22 April 2014 18:08, Chander Kashyap chander.kash...@linaro.org
 wrote:

 In menu_select function we check for correction factor every time.
 If it is zero we are initializing to unity. Hence move it to init
 function
 and initialise by unity, hence avoid repeated comparisons.

 Signed-off-by: Chander Kashyap chander.kash...@linaro.org
 Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org
 ---
   drivers/cpuidle/governors/menu.c |   15 ---
   1 file changed, 8 insertions(+), 7 deletions(-)

 diff --git a/drivers/cpuidle/governors/menu.c
 b/drivers/cpuidle/governors/menu.c
 index 71b5232..9b7918c 100644
 --- a/drivers/cpuidle/governors/menu.c
 +++ b/drivers/cpuidle/governors/menu.c
 @@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv,
 struct cpuidle_device *dev)
  data-bucket = which_bucket(data-next_timer_us);

  /*
 -* if the correction factor is 0 (eg first time init or cpu
 hotplug
 -* etc), we actually want to start out with a unity factor.
 -*/
 -   if (data-correction_factor[data-bucket] == 0)
 -   data-correction_factor[data-bucket] = RESOLUTION *
 DECAY;
 -
 -   /*
   * Force the result of multiplication to be 64 bits even if both
   * operands are 32 bits.
   * Make sure to round up for half microseconds.
 @@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver
 *drv,
  struct cpuidle_device *dev)
   {
  struct menu_device *data = per_cpu(menu_devices, dev-cpu);
 +   int i;

  memset(data, 0, sizeof(struct menu_device));

 +   /*
 +* if the correction factor is 0 (eg first time init or cpu
 hotplug
 +* etc), we actually want to start out with a unity factor.
 +*/
 +   for(i = 0; i  BUCKETS; i++)
 +   data-correction_factor[i] = RESOLUTION * DECAY;
 +
  return 0;
   }

 ping.


 I believe this is in linux-next today, care to check?

 Rafael


Thanks, Rafael

-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Chander Kashyap
In menu_select function we check for correction factor every time.
If it is zero we are initializing to unity. Hence move it to init function
and initialise by unity, hence avoid repeated comparisons.

Signed-off-by: Chander Kashyap 
Reviewed-by: Tuukka Tikkanen 
---
 drivers/cpuidle/governors/menu.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 71b5232..9b7918c 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv, struct 
cpuidle_device *dev)
data->bucket = which_bucket(data->next_timer_us);
 
/*
-* if the correction factor is 0 (eg first time init or cpu hotplug
-* etc), we actually want to start out with a unity factor.
-*/
-   if (data->correction_factor[data->bucket] == 0)
-   data->correction_factor[data->bucket] = RESOLUTION * DECAY;
-
-   /*
 * Force the result of multiplication to be 64 bits even if both
 * operands are 32 bits.
 * Make sure to round up for half microseconds.
@@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
struct cpuidle_device *dev)
 {
struct menu_device *data = _cpu(menu_devices, dev->cpu);
+   int i;
 
memset(data, 0, sizeof(struct menu_device));
 
+   /*
+* if the correction factor is 0 (eg first time init or cpu hotplug
+* etc), we actually want to start out with a unity factor.
+*/
+   for(i = 0; i < BUCKETS; i++)
+   data->correction_factor[i] = RESOLUTION * DECAY;
+
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Chander Kashyap
On 22 April 2014 16:54, Rafael J. Wysocki  wrote:
> On Tuesday, April 22, 2014 03:24:21 PM Chander Kashyap wrote:
>> +cc
>> linux...@vger.kernel.org.
>
> And can you please resend the patch?  So that it shows up in Patchwork,
> for example?
>

Yes i will resend it again.

>
>> On 22 April 2014 15:33, Rafael J. Wysocki  wrote:
>> > On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
>> >> ping
>> >
>> > Please CC cpuidle patches to linux...@vger.kernel.org.
>>
>> +cc to linux...@vger.kernel.org.
>> Thanks Rafael
>>
>> >
>> > Thanks!
>> >
>> >> On 10 April 2014 19:57, Tuukka Tikkanen  
>> >> wrote:
>> >> > On 10 April 2014 16:43, Chander Kashyap  
>> >> > wrote:
>> >> >> In menu_select function we check for correction factor every time.
>> >> >> If it is zero we are initializing to unity. Hence move it to init 
>> >> >> function
>> >> >> and initialise by unity, hence avoid repeated comparisons.
>> >> >>
>> >> >> Signed-off-by: Chander Kashyap 
>> >> >> ---
>> >> >>  drivers/cpuidle/governors/menu.c |   15 ---
>> >> >>  1 file changed, 8 insertions(+), 7 deletions(-)
>> >> >>
>> >> >> diff --git a/drivers/cpuidle/governors/menu.c 
>> >> >> b/drivers/cpuidle/governors/menu.c
>> >> >> index cf7f2f0..048f6d9 100644
>> >> >> --- a/drivers/cpuidle/governors/menu.c
>> >> >> +++ b/drivers/cpuidle/governors/menu.c
>> >> >> @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver 
>> >> >> *drv, struct cpuidle_device *dev)
>> >> >> multiplier = performance_multiplier();
>> >> >>
>> >> >> /*
>> >> >> -* if the correction factor is 0 (eg first time init or cpu 
>> >> >> hotplug
>> >> >> -* etc), we actually want to start out with a unity factor.
>> >> >> -*/
>> >> >> -   if (data->correction_factor[data->bucket] == 0)
>> >> >> -   data->correction_factor[data->bucket] = RESOLUTION * 
>> >> >> DECAY;
>> >> >> -
>> >> >> -   /*
>> >> >>  * Force the result of multiplication to be 64 bits even if 
>> >> >> both
>> >> >>  * operands are 32 bits.
>> >> >>  * Make sure to round up for half microseconds.
>> >> >> @@ -453,9 +446,17 @@ static int menu_enable_device(struct 
>> >> >> cpuidle_driver *drv,
>> >> >> struct cpuidle_device *dev)
>> >> >>  {
>> >> >> struct menu_device *data = _cpu(menu_devices, dev->cpu);
>> >> >> +   int i;
>> >> >>
>> >> >> memset(data, 0, sizeof(struct menu_device));
>> >> >>
>> >> >> +   /*
>> >> >> +* if the correction factor is 0 (eg first time init or cpu 
>> >> >> hotplug
>> >> >> +* etc), we actually want to start out with a unity factor.
>> >> >> +*/
>> >> >> +   for(i = 0; i < BUCKETS; i++)
>> >> >> +   data->correction_factor[i] = RESOLUTION * DECAY;
>> >> >> +
>> >> >> return 0;
>> >> >>  }
>> >> >>
>> >> >> --
>> >> >> 1.7.9.5
>> >> >>
>> >> >
>> >> > Reviewed-by: Tuukka Tikkanen 
>> >>
>> >>
>> >>
>> >>
>> >
>> > --
>> > I speak only for myself.
>> > Rafael J. Wysocki, Intel Open Source Technology Center.
>>
>>
>>
>>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.



-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Rafael J. Wysocki
On Tuesday, April 22, 2014 03:24:21 PM Chander Kashyap wrote:
> +cc
> linux...@vger.kernel.org.

And can you please resend the patch?  So that it shows up in Patchwork,
for example?


> On 22 April 2014 15:33, Rafael J. Wysocki  wrote:
> > On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
> >> ping
> >
> > Please CC cpuidle patches to linux...@vger.kernel.org.
> 
> +cc to linux...@vger.kernel.org.
> Thanks Rafael
> 
> >
> > Thanks!
> >
> >> On 10 April 2014 19:57, Tuukka Tikkanen  wrote:
> >> > On 10 April 2014 16:43, Chander Kashyap  
> >> > wrote:
> >> >> In menu_select function we check for correction factor every time.
> >> >> If it is zero we are initializing to unity. Hence move it to init 
> >> >> function
> >> >> and initialise by unity, hence avoid repeated comparisons.
> >> >>
> >> >> Signed-off-by: Chander Kashyap 
> >> >> ---
> >> >>  drivers/cpuidle/governors/menu.c |   15 ---
> >> >>  1 file changed, 8 insertions(+), 7 deletions(-)
> >> >>
> >> >> diff --git a/drivers/cpuidle/governors/menu.c 
> >> >> b/drivers/cpuidle/governors/menu.c
> >> >> index cf7f2f0..048f6d9 100644
> >> >> --- a/drivers/cpuidle/governors/menu.c
> >> >> +++ b/drivers/cpuidle/governors/menu.c
> >> >> @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
> >> >> struct cpuidle_device *dev)
> >> >> multiplier = performance_multiplier();
> >> >>
> >> >> /*
> >> >> -* if the correction factor is 0 (eg first time init or cpu 
> >> >> hotplug
> >> >> -* etc), we actually want to start out with a unity factor.
> >> >> -*/
> >> >> -   if (data->correction_factor[data->bucket] == 0)
> >> >> -   data->correction_factor[data->bucket] = RESOLUTION * 
> >> >> DECAY;
> >> >> -
> >> >> -   /*
> >> >>  * Force the result of multiplication to be 64 bits even if both
> >> >>  * operands are 32 bits.
> >> >>  * Make sure to round up for half microseconds.
> >> >> @@ -453,9 +446,17 @@ static int menu_enable_device(struct 
> >> >> cpuidle_driver *drv,
> >> >> struct cpuidle_device *dev)
> >> >>  {
> >> >> struct menu_device *data = _cpu(menu_devices, dev->cpu);
> >> >> +   int i;
> >> >>
> >> >> memset(data, 0, sizeof(struct menu_device));
> >> >>
> >> >> +   /*
> >> >> +* if the correction factor is 0 (eg first time init or cpu 
> >> >> hotplug
> >> >> +* etc), we actually want to start out with a unity factor.
> >> >> +*/
> >> >> +   for(i = 0; i < BUCKETS; i++)
> >> >> +   data->correction_factor[i] = RESOLUTION * DECAY;
> >> >> +
> >> >> return 0;
> >> >>  }
> >> >>
> >> >> --
> >> >> 1.7.9.5
> >> >>
> >> >
> >> > Reviewed-by: Tuukka Tikkanen 
> >>
> >>
> >>
> >>
> >
> > --
> > I speak only for myself.
> > Rafael J. Wysocki, Intel Open Source Technology Center.
> 
> 
> 
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Chander Kashyap
+cc
linux...@vger.kernel.org.

On 22 April 2014 15:33, Rafael J. Wysocki  wrote:
> On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
>> ping
>
> Please CC cpuidle patches to linux...@vger.kernel.org.

+cc to linux...@vger.kernel.org.
Thanks Rafael

>
> Thanks!
>
>> On 10 April 2014 19:57, Tuukka Tikkanen  wrote:
>> > On 10 April 2014 16:43, Chander Kashyap  wrote:
>> >> In menu_select function we check for correction factor every time.
>> >> If it is zero we are initializing to unity. Hence move it to init function
>> >> and initialise by unity, hence avoid repeated comparisons.
>> >>
>> >> Signed-off-by: Chander Kashyap 
>> >> ---
>> >>  drivers/cpuidle/governors/menu.c |   15 ---
>> >>  1 file changed, 8 insertions(+), 7 deletions(-)
>> >>
>> >> diff --git a/drivers/cpuidle/governors/menu.c 
>> >> b/drivers/cpuidle/governors/menu.c
>> >> index cf7f2f0..048f6d9 100644
>> >> --- a/drivers/cpuidle/governors/menu.c
>> >> +++ b/drivers/cpuidle/governors/menu.c
>> >> @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
>> >> struct cpuidle_device *dev)
>> >> multiplier = performance_multiplier();
>> >>
>> >> /*
>> >> -* if the correction factor is 0 (eg first time init or cpu 
>> >> hotplug
>> >> -* etc), we actually want to start out with a unity factor.
>> >> -*/
>> >> -   if (data->correction_factor[data->bucket] == 0)
>> >> -   data->correction_factor[data->bucket] = RESOLUTION * 
>> >> DECAY;
>> >> -
>> >> -   /*
>> >>  * Force the result of multiplication to be 64 bits even if both
>> >>  * operands are 32 bits.
>> >>  * Make sure to round up for half microseconds.
>> >> @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver 
>> >> *drv,
>> >> struct cpuidle_device *dev)
>> >>  {
>> >> struct menu_device *data = _cpu(menu_devices, dev->cpu);
>> >> +   int i;
>> >>
>> >> memset(data, 0, sizeof(struct menu_device));
>> >>
>> >> +   /*
>> >> +* if the correction factor is 0 (eg first time init or cpu 
>> >> hotplug
>> >> +* etc), we actually want to start out with a unity factor.
>> >> +*/
>> >> +   for(i = 0; i < BUCKETS; i++)
>> >> +   data->correction_factor[i] = RESOLUTION * DECAY;
>> >> +
>> >> return 0;
>> >>  }
>> >>
>> >> --
>> >> 1.7.9.5
>> >>
>> >
>> > Reviewed-by: Tuukka Tikkanen 
>>
>>
>>
>>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.



-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Rafael J. Wysocki
On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
> ping

Please CC cpuidle patches to linux...@vger.kernel.org.

Thanks!

> On 10 April 2014 19:57, Tuukka Tikkanen  wrote:
> > On 10 April 2014 16:43, Chander Kashyap  wrote:
> >> In menu_select function we check for correction factor every time.
> >> If it is zero we are initializing to unity. Hence move it to init function
> >> and initialise by unity, hence avoid repeated comparisons.
> >>
> >> Signed-off-by: Chander Kashyap 
> >> ---
> >>  drivers/cpuidle/governors/menu.c |   15 ---
> >>  1 file changed, 8 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/cpuidle/governors/menu.c 
> >> b/drivers/cpuidle/governors/menu.c
> >> index cf7f2f0..048f6d9 100644
> >> --- a/drivers/cpuidle/governors/menu.c
> >> +++ b/drivers/cpuidle/governors/menu.c
> >> @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
> >> struct cpuidle_device *dev)
> >> multiplier = performance_multiplier();
> >>
> >> /*
> >> -* if the correction factor is 0 (eg first time init or cpu hotplug
> >> -* etc), we actually want to start out with a unity factor.
> >> -*/
> >> -   if (data->correction_factor[data->bucket] == 0)
> >> -   data->correction_factor[data->bucket] = RESOLUTION * DECAY;
> >> -
> >> -   /*
> >>  * Force the result of multiplication to be 64 bits even if both
> >>  * operands are 32 bits.
> >>  * Make sure to round up for half microseconds.
> >> @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver 
> >> *drv,
> >> struct cpuidle_device *dev)
> >>  {
> >> struct menu_device *data = _cpu(menu_devices, dev->cpu);
> >> +   int i;
> >>
> >> memset(data, 0, sizeof(struct menu_device));
> >>
> >> +   /*
> >> +* if the correction factor is 0 (eg first time init or cpu hotplug
> >> +* etc), we actually want to start out with a unity factor.
> >> +*/
> >> +   for(i = 0; i < BUCKETS; i++)
> >> +   data->correction_factor[i] = RESOLUTION * DECAY;
> >> +
> >> return 0;
> >>  }
> >>
> >> --
> >> 1.7.9.5
> >>
> >
> > Reviewed-by: Tuukka Tikkanen 
> 
> 
> 
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Rafael J. Wysocki
On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
 ping

Please CC cpuidle patches to linux...@vger.kernel.org.

Thanks!

 On 10 April 2014 19:57, Tuukka Tikkanen tuukka.tikka...@linaro.org wrote:
  On 10 April 2014 16:43, Chander Kashyap chander.kash...@linaro.org wrote:
  In menu_select function we check for correction factor every time.
  If it is zero we are initializing to unity. Hence move it to init function
  and initialise by unity, hence avoid repeated comparisons.
 
  Signed-off-by: Chander Kashyap chander.kash...@linaro.org
  ---
   drivers/cpuidle/governors/menu.c |   15 ---
   1 file changed, 8 insertions(+), 7 deletions(-)
 
  diff --git a/drivers/cpuidle/governors/menu.c 
  b/drivers/cpuidle/governors/menu.c
  index cf7f2f0..048f6d9 100644
  --- a/drivers/cpuidle/governors/menu.c
  +++ b/drivers/cpuidle/governors/menu.c
  @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
  struct cpuidle_device *dev)
  multiplier = performance_multiplier();
 
  /*
  -* if the correction factor is 0 (eg first time init or cpu hotplug
  -* etc), we actually want to start out with a unity factor.
  -*/
  -   if (data-correction_factor[data-bucket] == 0)
  -   data-correction_factor[data-bucket] = RESOLUTION * DECAY;
  -
  -   /*
   * Force the result of multiplication to be 64 bits even if both
   * operands are 32 bits.
   * Make sure to round up for half microseconds.
  @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver 
  *drv,
  struct cpuidle_device *dev)
   {
  struct menu_device *data = per_cpu(menu_devices, dev-cpu);
  +   int i;
 
  memset(data, 0, sizeof(struct menu_device));
 
  +   /*
  +* if the correction factor is 0 (eg first time init or cpu hotplug
  +* etc), we actually want to start out with a unity factor.
  +*/
  +   for(i = 0; i  BUCKETS; i++)
  +   data-correction_factor[i] = RESOLUTION * DECAY;
  +
  return 0;
   }
 
  --
  1.7.9.5
 
 
  Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org
 
 
 
 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Chander Kashyap
+cc
linux...@vger.kernel.org.

On 22 April 2014 15:33, Rafael J. Wysocki r...@rjwysocki.net wrote:
 On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
 ping

 Please CC cpuidle patches to linux...@vger.kernel.org.

+cc to linux...@vger.kernel.org.
Thanks Rafael


 Thanks!

 On 10 April 2014 19:57, Tuukka Tikkanen tuukka.tikka...@linaro.org wrote:
  On 10 April 2014 16:43, Chander Kashyap chander.kash...@linaro.org wrote:
  In menu_select function we check for correction factor every time.
  If it is zero we are initializing to unity. Hence move it to init function
  and initialise by unity, hence avoid repeated comparisons.
 
  Signed-off-by: Chander Kashyap chander.kash...@linaro.org
  ---
   drivers/cpuidle/governors/menu.c |   15 ---
   1 file changed, 8 insertions(+), 7 deletions(-)
 
  diff --git a/drivers/cpuidle/governors/menu.c 
  b/drivers/cpuidle/governors/menu.c
  index cf7f2f0..048f6d9 100644
  --- a/drivers/cpuidle/governors/menu.c
  +++ b/drivers/cpuidle/governors/menu.c
  @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
  struct cpuidle_device *dev)
  multiplier = performance_multiplier();
 
  /*
  -* if the correction factor is 0 (eg first time init or cpu 
  hotplug
  -* etc), we actually want to start out with a unity factor.
  -*/
  -   if (data-correction_factor[data-bucket] == 0)
  -   data-correction_factor[data-bucket] = RESOLUTION * 
  DECAY;
  -
  -   /*
   * Force the result of multiplication to be 64 bits even if both
   * operands are 32 bits.
   * Make sure to round up for half microseconds.
  @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver 
  *drv,
  struct cpuidle_device *dev)
   {
  struct menu_device *data = per_cpu(menu_devices, dev-cpu);
  +   int i;
 
  memset(data, 0, sizeof(struct menu_device));
 
  +   /*
  +* if the correction factor is 0 (eg first time init or cpu 
  hotplug
  +* etc), we actually want to start out with a unity factor.
  +*/
  +   for(i = 0; i  BUCKETS; i++)
  +   data-correction_factor[i] = RESOLUTION * DECAY;
  +
  return 0;
   }
 
  --
  1.7.9.5
 
 
  Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org





 --
 I speak only for myself.
 Rafael J. Wysocki, Intel Open Source Technology Center.



-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Rafael J. Wysocki
On Tuesday, April 22, 2014 03:24:21 PM Chander Kashyap wrote:
 +cc
 linux...@vger.kernel.org.

And can you please resend the patch?  So that it shows up in Patchwork,
for example?


 On 22 April 2014 15:33, Rafael J. Wysocki r...@rjwysocki.net wrote:
  On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
  ping
 
  Please CC cpuidle patches to linux...@vger.kernel.org.
 
 +cc to linux...@vger.kernel.org.
 Thanks Rafael
 
 
  Thanks!
 
  On 10 April 2014 19:57, Tuukka Tikkanen tuukka.tikka...@linaro.org wrote:
   On 10 April 2014 16:43, Chander Kashyap chander.kash...@linaro.org 
   wrote:
   In menu_select function we check for correction factor every time.
   If it is zero we are initializing to unity. Hence move it to init 
   function
   and initialise by unity, hence avoid repeated comparisons.
  
   Signed-off-by: Chander Kashyap chander.kash...@linaro.org
   ---
drivers/cpuidle/governors/menu.c |   15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
  
   diff --git a/drivers/cpuidle/governors/menu.c 
   b/drivers/cpuidle/governors/menu.c
   index cf7f2f0..048f6d9 100644
   --- a/drivers/cpuidle/governors/menu.c
   +++ b/drivers/cpuidle/governors/menu.c
   @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
   struct cpuidle_device *dev)
   multiplier = performance_multiplier();
  
   /*
   -* if the correction factor is 0 (eg first time init or cpu 
   hotplug
   -* etc), we actually want to start out with a unity factor.
   -*/
   -   if (data-correction_factor[data-bucket] == 0)
   -   data-correction_factor[data-bucket] = RESOLUTION * 
   DECAY;
   -
   -   /*
* Force the result of multiplication to be 64 bits even if both
* operands are 32 bits.
* Make sure to round up for half microseconds.
   @@ -453,9 +446,17 @@ static int menu_enable_device(struct 
   cpuidle_driver *drv,
   struct cpuidle_device *dev)
{
   struct menu_device *data = per_cpu(menu_devices, dev-cpu);
   +   int i;
  
   memset(data, 0, sizeof(struct menu_device));
  
   +   /*
   +* if the correction factor is 0 (eg first time init or cpu 
   hotplug
   +* etc), we actually want to start out with a unity factor.
   +*/
   +   for(i = 0; i  BUCKETS; i++)
   +   data-correction_factor[i] = RESOLUTION * DECAY;
   +
   return 0;
}
  
   --
   1.7.9.5
  
  
   Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org
 
 
 
 
 
  --
  I speak only for myself.
  Rafael J. Wysocki, Intel Open Source Technology Center.
 
 
 
 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Chander Kashyap
On 22 April 2014 16:54, Rafael J. Wysocki r...@rjwysocki.net wrote:
 On Tuesday, April 22, 2014 03:24:21 PM Chander Kashyap wrote:
 +cc
 linux...@vger.kernel.org.

 And can you please resend the patch?  So that it shows up in Patchwork,
 for example?


Yes i will resend it again.


 On 22 April 2014 15:33, Rafael J. Wysocki r...@rjwysocki.net wrote:
  On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
  ping
 
  Please CC cpuidle patches to linux...@vger.kernel.org.

 +cc to linux...@vger.kernel.org.
 Thanks Rafael

 
  Thanks!
 
  On 10 April 2014 19:57, Tuukka Tikkanen tuukka.tikka...@linaro.org 
  wrote:
   On 10 April 2014 16:43, Chander Kashyap chander.kash...@linaro.org 
   wrote:
   In menu_select function we check for correction factor every time.
   If it is zero we are initializing to unity. Hence move it to init 
   function
   and initialise by unity, hence avoid repeated comparisons.
  
   Signed-off-by: Chander Kashyap chander.kash...@linaro.org
   ---
drivers/cpuidle/governors/menu.c |   15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
  
   diff --git a/drivers/cpuidle/governors/menu.c 
   b/drivers/cpuidle/governors/menu.c
   index cf7f2f0..048f6d9 100644
   --- a/drivers/cpuidle/governors/menu.c
   +++ b/drivers/cpuidle/governors/menu.c
   @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver 
   *drv, struct cpuidle_device *dev)
   multiplier = performance_multiplier();
  
   /*
   -* if the correction factor is 0 (eg first time init or cpu 
   hotplug
   -* etc), we actually want to start out with a unity factor.
   -*/
   -   if (data-correction_factor[data-bucket] == 0)
   -   data-correction_factor[data-bucket] = RESOLUTION * 
   DECAY;
   -
   -   /*
* Force the result of multiplication to be 64 bits even if 
   both
* operands are 32 bits.
* Make sure to round up for half microseconds.
   @@ -453,9 +446,17 @@ static int menu_enable_device(struct 
   cpuidle_driver *drv,
   struct cpuidle_device *dev)
{
   struct menu_device *data = per_cpu(menu_devices, dev-cpu);
   +   int i;
  
   memset(data, 0, sizeof(struct menu_device));
  
   +   /*
   +* if the correction factor is 0 (eg first time init or cpu 
   hotplug
   +* etc), we actually want to start out with a unity factor.
   +*/
   +   for(i = 0; i  BUCKETS; i++)
   +   data-correction_factor[i] = RESOLUTION * DECAY;
   +
   return 0;
}
  
   --
   1.7.9.5
  
  
   Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org
 
 
 
 
 
  --
  I speak only for myself.
  Rafael J. Wysocki, Intel Open Source Technology Center.





 --
 I speak only for myself.
 Rafael J. Wysocki, Intel Open Source Technology Center.



-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-22 Thread Chander Kashyap
In menu_select function we check for correction factor every time.
If it is zero we are initializing to unity. Hence move it to init function
and initialise by unity, hence avoid repeated comparisons.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org
---
 drivers/cpuidle/governors/menu.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 71b5232..9b7918c 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv, struct 
cpuidle_device *dev)
data-bucket = which_bucket(data-next_timer_us);
 
/*
-* if the correction factor is 0 (eg first time init or cpu hotplug
-* etc), we actually want to start out with a unity factor.
-*/
-   if (data-correction_factor[data-bucket] == 0)
-   data-correction_factor[data-bucket] = RESOLUTION * DECAY;
-
-   /*
 * Force the result of multiplication to be 64 bits even if both
 * operands are 32 bits.
 * Make sure to round up for half microseconds.
@@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
struct cpuidle_device *dev)
 {
struct menu_device *data = per_cpu(menu_devices, dev-cpu);
+   int i;
 
memset(data, 0, sizeof(struct menu_device));
 
+   /*
+* if the correction factor is 0 (eg first time init or cpu hotplug
+* etc), we actually want to start out with a unity factor.
+*/
+   for(i = 0; i  BUCKETS; i++)
+   data-correction_factor[i] = RESOLUTION * DECAY;
+
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-21 Thread Chander Kashyap
ping

On 10 April 2014 19:57, Tuukka Tikkanen  wrote:
> On 10 April 2014 16:43, Chander Kashyap  wrote:
>> In menu_select function we check for correction factor every time.
>> If it is zero we are initializing to unity. Hence move it to init function
>> and initialise by unity, hence avoid repeated comparisons.
>>
>> Signed-off-by: Chander Kashyap 
>> ---
>>  drivers/cpuidle/governors/menu.c |   15 ---
>>  1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/cpuidle/governors/menu.c 
>> b/drivers/cpuidle/governors/menu.c
>> index cf7f2f0..048f6d9 100644
>> --- a/drivers/cpuidle/governors/menu.c
>> +++ b/drivers/cpuidle/governors/menu.c
>> @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
>> struct cpuidle_device *dev)
>> multiplier = performance_multiplier();
>>
>> /*
>> -* if the correction factor is 0 (eg first time init or cpu hotplug
>> -* etc), we actually want to start out with a unity factor.
>> -*/
>> -   if (data->correction_factor[data->bucket] == 0)
>> -   data->correction_factor[data->bucket] = RESOLUTION * DECAY;
>> -
>> -   /*
>>  * Force the result of multiplication to be 64 bits even if both
>>  * operands are 32 bits.
>>  * Make sure to round up for half microseconds.
>> @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver 
>> *drv,
>> struct cpuidle_device *dev)
>>  {
>> struct menu_device *data = _cpu(menu_devices, dev->cpu);
>> +   int i;
>>
>> memset(data, 0, sizeof(struct menu_device));
>>
>> +   /*
>> +* if the correction factor is 0 (eg first time init or cpu hotplug
>> +* etc), we actually want to start out with a unity factor.
>> +*/
>> +   for(i = 0; i < BUCKETS; i++)
>> +   data->correction_factor[i] = RESOLUTION * DECAY;
>> +
>> return 0;
>>  }
>>
>> --
>> 1.7.9.5
>>
>
> Reviewed-by: Tuukka Tikkanen 



-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-21 Thread Chander Kashyap
ping

On 10 April 2014 19:57, Tuukka Tikkanen tuukka.tikka...@linaro.org wrote:
 On 10 April 2014 16:43, Chander Kashyap chander.kash...@linaro.org wrote:
 In menu_select function we check for correction factor every time.
 If it is zero we are initializing to unity. Hence move it to init function
 and initialise by unity, hence avoid repeated comparisons.

 Signed-off-by: Chander Kashyap chander.kash...@linaro.org
 ---
  drivers/cpuidle/governors/menu.c |   15 ---
  1 file changed, 8 insertions(+), 7 deletions(-)

 diff --git a/drivers/cpuidle/governors/menu.c 
 b/drivers/cpuidle/governors/menu.c
 index cf7f2f0..048f6d9 100644
 --- a/drivers/cpuidle/governors/menu.c
 +++ b/drivers/cpuidle/governors/menu.c
 @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
 struct cpuidle_device *dev)
 multiplier = performance_multiplier();

 /*
 -* if the correction factor is 0 (eg first time init or cpu hotplug
 -* etc), we actually want to start out with a unity factor.
 -*/
 -   if (data-correction_factor[data-bucket] == 0)
 -   data-correction_factor[data-bucket] = RESOLUTION * DECAY;
 -
 -   /*
  * Force the result of multiplication to be 64 bits even if both
  * operands are 32 bits.
  * Make sure to round up for half microseconds.
 @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver 
 *drv,
 struct cpuidle_device *dev)
  {
 struct menu_device *data = per_cpu(menu_devices, dev-cpu);
 +   int i;

 memset(data, 0, sizeof(struct menu_device));

 +   /*
 +* if the correction factor is 0 (eg first time init or cpu hotplug
 +* etc), we actually want to start out with a unity factor.
 +*/
 +   for(i = 0; i  BUCKETS; i++)
 +   data-correction_factor[i] = RESOLUTION * DECAY;
 +
 return 0;
  }

 --
 1.7.9.5


 Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org



-- 
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-10 Thread Tuukka Tikkanen
On 10 April 2014 16:43, Chander Kashyap  wrote:
> In menu_select function we check for correction factor every time.
> If it is zero we are initializing to unity. Hence move it to init function
> and initialise by unity, hence avoid repeated comparisons.
>
> Signed-off-by: Chander Kashyap 
> ---
>  drivers/cpuidle/governors/menu.c |   15 ---
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/cpuidle/governors/menu.c 
> b/drivers/cpuidle/governors/menu.c
> index cf7f2f0..048f6d9 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
> struct cpuidle_device *dev)
> multiplier = performance_multiplier();
>
> /*
> -* if the correction factor is 0 (eg first time init or cpu hotplug
> -* etc), we actually want to start out with a unity factor.
> -*/
> -   if (data->correction_factor[data->bucket] == 0)
> -   data->correction_factor[data->bucket] = RESOLUTION * DECAY;
> -
> -   /*
>  * Force the result of multiplication to be 64 bits even if both
>  * operands are 32 bits.
>  * Make sure to round up for half microseconds.
> @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
> struct cpuidle_device *dev)
>  {
> struct menu_device *data = _cpu(menu_devices, dev->cpu);
> +   int i;
>
> memset(data, 0, sizeof(struct menu_device));
>
> +   /*
> +* if the correction factor is 0 (eg first time init or cpu hotplug
> +* etc), we actually want to start out with a unity factor.
> +*/
> +   for(i = 0; i < BUCKETS; i++)
> +   data->correction_factor[i] = RESOLUTION * DECAY;
> +
> return 0;
>  }
>
> --
> 1.7.9.5
>

Reviewed-by: Tuukka Tikkanen 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-10 Thread Chander Kashyap
In menu_select function we check for correction factor every time.
If it is zero we are initializing to unity. Hence move it to init function
and initialise by unity, hence avoid repeated comparisons.

Signed-off-by: Chander Kashyap 
---
 drivers/cpuidle/governors/menu.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index cf7f2f0..048f6d9 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, struct 
cpuidle_device *dev)
multiplier = performance_multiplier();
 
/*
-* if the correction factor is 0 (eg first time init or cpu hotplug
-* etc), we actually want to start out with a unity factor.
-*/
-   if (data->correction_factor[data->bucket] == 0)
-   data->correction_factor[data->bucket] = RESOLUTION * DECAY;
-
-   /*
 * Force the result of multiplication to be 64 bits even if both
 * operands are 32 bits.
 * Make sure to round up for half microseconds.
@@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
struct cpuidle_device *dev)
 {
struct menu_device *data = _cpu(menu_devices, dev->cpu);
+   int i;
 
memset(data, 0, sizeof(struct menu_device));
 
+   /*
+* if the correction factor is 0 (eg first time init or cpu hotplug
+* etc), we actually want to start out with a unity factor.
+*/
+   for(i = 0; i < BUCKETS; i++)
+   data->correction_factor[i] = RESOLUTION * DECAY;
+
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-10 Thread Chander Kashyap
In menu_select function we check for correction factor every time.
If it is zero we are initializing to unity. Hence move it to init function
and initialise by unity, hence avoid repeated comparisons.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
---
 drivers/cpuidle/governors/menu.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index cf7f2f0..048f6d9 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, struct 
cpuidle_device *dev)
multiplier = performance_multiplier();
 
/*
-* if the correction factor is 0 (eg first time init or cpu hotplug
-* etc), we actually want to start out with a unity factor.
-*/
-   if (data-correction_factor[data-bucket] == 0)
-   data-correction_factor[data-bucket] = RESOLUTION * DECAY;
-
-   /*
 * Force the result of multiplication to be 64 bits even if both
 * operands are 32 bits.
 * Make sure to round up for half microseconds.
@@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
struct cpuidle_device *dev)
 {
struct menu_device *data = per_cpu(menu_devices, dev-cpu);
+   int i;
 
memset(data, 0, sizeof(struct menu_device));
 
+   /*
+* if the correction factor is 0 (eg first time init or cpu hotplug
+* etc), we actually want to start out with a unity factor.
+*/
+   for(i = 0; i  BUCKETS; i++)
+   data-correction_factor[i] = RESOLUTION * DECAY;
+
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init

2014-04-10 Thread Tuukka Tikkanen
On 10 April 2014 16:43, Chander Kashyap chander.kash...@linaro.org wrote:
 In menu_select function we check for correction factor every time.
 If it is zero we are initializing to unity. Hence move it to init function
 and initialise by unity, hence avoid repeated comparisons.

 Signed-off-by: Chander Kashyap chander.kash...@linaro.org
 ---
  drivers/cpuidle/governors/menu.c |   15 ---
  1 file changed, 8 insertions(+), 7 deletions(-)

 diff --git a/drivers/cpuidle/governors/menu.c 
 b/drivers/cpuidle/governors/menu.c
 index cf7f2f0..048f6d9 100644
 --- a/drivers/cpuidle/governors/menu.c
 +++ b/drivers/cpuidle/governors/menu.c
 @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, 
 struct cpuidle_device *dev)
 multiplier = performance_multiplier();

 /*
 -* if the correction factor is 0 (eg first time init or cpu hotplug
 -* etc), we actually want to start out with a unity factor.
 -*/
 -   if (data-correction_factor[data-bucket] == 0)
 -   data-correction_factor[data-bucket] = RESOLUTION * DECAY;
 -
 -   /*
  * Force the result of multiplication to be 64 bits even if both
  * operands are 32 bits.
  * Make sure to round up for half microseconds.
 @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
 struct cpuidle_device *dev)
  {
 struct menu_device *data = per_cpu(menu_devices, dev-cpu);
 +   int i;

 memset(data, 0, sizeof(struct menu_device));

 +   /*
 +* if the correction factor is 0 (eg first time init or cpu hotplug
 +* etc), we actually want to start out with a unity factor.
 +*/
 +   for(i = 0; i  BUCKETS; i++)
 +   data-correction_factor[i] = RESOLUTION * DECAY;
 +
 return 0;
  }

 --
 1.7.9.5


Reviewed-by: Tuukka Tikkanen tuukka.tikka...@linaro.org
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/