linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq/intel_pstate: Set timer timeout correctly
@ 2013-04-04 17:35 dirk.brandewie
  2013-04-05  5:19 ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: dirk.brandewie @ 2013-04-04 17:35 UTC (permalink / raw)
  To: rjw, linux-kernel, cpufreq; +Cc: Dirk Brandewie

From: Dirk Brandewie <dirk.brandewie@gmail.com>

The current calculation of the delay time is wrong and a cut and paste
error from a previous experimental driver.  This can result in the
timeout being set to jiffies + 1 which setup the driver to race with
it's self if the apic timer interrupt happen at just the right time.


https://bugzilla.redhat.com/show_bug.cgi?id=920289

Reported-by: Adam Williamson <awilliam@redhat.com>
Reported-by: Parag Warudkar <parag.lkml@gmail.com>

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
---
 drivers/cpufreq/intel_pstate.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 43ffe1c..4d6b988 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -502,7 +502,6 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu)
 
 	sample_time = cpu->pstate_policy->sample_rate_ms;
 	delay = msecs_to_jiffies(sample_time);
-	delay -= jiffies % delay;
 	mod_timer_pinned(&cpu->timer, jiffies + delay);
 }
 
-- 
1.7.7.6


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

* Re: [PATCH] cpufreq/intel_pstate: Set timer timeout correctly
  2013-04-04 17:35 [PATCH] cpufreq/intel_pstate: Set timer timeout correctly dirk.brandewie
@ 2013-04-05  5:19 ` Viresh Kumar
  2013-04-05  5:42   ` Adam Williamson
  2013-04-05 23:46   ` Parag Warudkar
  0 siblings, 2 replies; 4+ messages in thread
From: Viresh Kumar @ 2013-04-05  5:19 UTC (permalink / raw)
  To: dirk.brandewie, Adam Williamson, Parag Warudkar
  Cc: rjw, linux-kernel, cpufreq

On Thu, Apr 4, 2013 at 11:05 PM,  <dirk.brandewie@gmail.com> wrote:
> From: Dirk Brandewie <dirk.brandewie@gmail.com>
>
> The current calculation of the delay time is wrong and a cut and paste
> error from a previous experimental driver.  This can result in the
> timeout being set to jiffies + 1 which setup the driver to race with
> it's self if the apic timer interrupt happen at just the right time.
>
>
> https://bugzilla.redhat.com/show_bug.cgi?id=920289
>
> Reported-by: Adam Williamson <awilliam@redhat.com>
> Reported-by: Parag Warudkar <parag.lkml@gmail.com>
>
> Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
> ---
>  drivers/cpufreq/intel_pstate.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)

Looks fine, but I would like to see a Tested-by from Adam/Parag
as they haven't said anything about this patch (even in bugzilla).

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

* Re: [PATCH] cpufreq/intel_pstate: Set timer timeout correctly
  2013-04-05  5:19 ` Viresh Kumar
@ 2013-04-05  5:42   ` Adam Williamson
  2013-04-05 23:46   ` Parag Warudkar
  1 sibling, 0 replies; 4+ messages in thread
From: Adam Williamson @ 2013-04-05  5:42 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: dirk.brandewie, Parag Warudkar, rjw, linux-kernel, cpufreq

On 04/04/13 10:19 PM, Viresh Kumar wrote:
> On Thu, Apr 4, 2013 at 11:05 PM,  <dirk.brandewie@gmail.com> wrote:
>> From: Dirk Brandewie <dirk.brandewie@gmail.com>
>>
>> The current calculation of the delay time is wrong and a cut and paste
>> error from a previous experimental driver.  This can result in the
>> timeout being set to jiffies + 1 which setup the driver to race with
>> it's self if the apic timer interrupt happen at just the right time.
>>
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=920289
>>
>> Reported-by: Adam Williamson <awilliam@redhat.com>
>> Reported-by: Parag Warudkar <parag.lkml@gmail.com>
>>
>> Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
>> ---
>>   drivers/cpufreq/intel_pstate.c |    1 -
>>   1 files changed, 0 insertions(+), 1 deletions(-)
>
> Looks fine, but I would like to see a Tested-by from Adam/Parag
> as they haven't said anything about this patch (even in bugzilla).

I'll try. Note the bug is not reliably reproducible, all I can really do 
is run for a day or two and see if it crashes.
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | identi.ca: adamwfedora
http://www.happyassassin.net

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

* Re: [PATCH] cpufreq/intel_pstate: Set timer timeout correctly
  2013-04-05  5:19 ` Viresh Kumar
  2013-04-05  5:42   ` Adam Williamson
@ 2013-04-05 23:46   ` Parag Warudkar
  1 sibling, 0 replies; 4+ messages in thread
From: Parag Warudkar @ 2013-04-05 23:46 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: dirk.brandewie, Adam Williamson, Parag Warudkar, rjw,
	linux-kernel, cpufreq



On Fri, 5 Apr 2013, Viresh Kumar wrote:

> On Thu, Apr 4, 2013 at 11:05 PM,  <dirk.brandewie@gmail.com> wrote:
> > From: Dirk Brandewie <dirk.brandewie@gmail.com>
> >
> > The current calculation of the delay time is wrong and a cut and paste
> > error from a previous experimental driver.  This can result in the
> > timeout being set to jiffies + 1 which setup the driver to race with
> > it's self if the apic timer interrupt happen at just the right time.
> >
> >
> > https://bugzilla.redhat.com/show_bug.cgi?id=920289
> >
> > Reported-by: Adam Williamson <awilliam@redhat.com>
> > Reported-by: Parag Warudkar <parag.lkml@gmail.com>
> >
> > Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
> > ---
> >  drivers/cpufreq/intel_pstate.c |    1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> Looks fine, but I would like to see a Tested-by from Adam/Parag
> as they haven't said anything about this patch (even in bugzilla).
> 

I am running with the patch since yesterday - everything looks good.

The issue hasn't been reproducible on demand but some code reading and 
Dirk's explanation says the patch should fix the issue.

So - Tested-by: Parag Warudkar <parag.lkml@gmail.com>

Parag

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

end of thread, other threads:[~2013-04-05 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 17:35 [PATCH] cpufreq/intel_pstate: Set timer timeout correctly dirk.brandewie
2013-04-05  5:19 ` Viresh Kumar
2013-04-05  5:42   ` Adam Williamson
2013-04-05 23:46   ` Parag Warudkar

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