* RE: [PATCH] transition latency of speedstep-ich (third try)
@ 2005-11-28 22:19 Pallipadi, Venkatesh
2005-11-28 23:35 ` Eric Piel
0 siblings, 1 reply; 13+ messages in thread
From: Pallipadi, Venkatesh @ 2005-11-28 22:19 UTC (permalink / raw)
To: Mattia Dongili, Eric Piel; +Cc: davej, Dominik Brodowski, cpufreq
>-----Original Message-----
>From: Mattia Dongili [mailto:malattia@linux.it]
>Sent: Monday, November 28, 2005 2:13 PM
>To: Eric Piel
>Cc: Pallipadi, Venkatesh; davej@redhat.com; Dominik Brodowski;
>cpufreq@lists.linux.org.uk
>Subject: Re: [PATCH] transition latency of speedstep-ich (third try)
>
>On Sat, Nov 26, 2005 at 11:40:20PM +0100, Eric Piel wrote:
>> 05.10.2005 22:39, Pallipadi, Venkatesh wrote/a écrit:
>[...]
>> >Do you have ACPI PM timer on your system? May be we can measure the
>> >latency using that.
>> >
>> Hello,
>>
>> Sorry for the looonnnggg delay of the reply. I've finally
>found time to
>> hunt for the PM timer on my computer, found it, and kludged
>> speedstep-ich to read it :-) For verification and completeness, the
>> patch is attached. (the PM timer address is hard-coded, it has to be
>> changed before running it on another system, it's indicated
>at boot in
>> dmesg).
>>
>> So the results are quite interesting and confirm your expectations,
>> Venki. After few hours with the ondemand governor, I checked
>the logs
>> and the transition latency seems very stable: around 735 to
>742 PM timer
>> ticks (~206 us). So indeed, 100us of transition latency was quite
>> under-estimating it!
>
>So here's some measurement on my P3M (seems a little faster than yours
>in switching):
>
>processor : 0
>vendor_id : GenuineIntel
>cpu family : 6
>model : 11
>model name : Intel(R) Pentium(R) III Mobile CPU 1000MHz
>stepping : 1
>cpu MHz : 994.394
>cache size : 512 KB
>fdiv_bug : no
>hlt_bug : no
>f00f_bug : no
>coma_bug : no
>fpu : yes
>fpu_exception : yes
>cpuid level : 2
>wp : yes
>flags : fpu vme de pse tsc msr pae mce cx8 apic sep
>mtrr pge mca cmov pat pse36 mmx fxsr sse
>bogomips : 1991.49
>
>
>cpufrequtils 0.3: cpufreq-info (C) Dominik Brodowski 2004
>Report errors and bugs to linux@brodo.de, please.
>analyzing CPU 0:
> driver: speedstep-ich
> CPUs which need to switch frequency at the same time: 0
> hardware limits: 732 MHz - 998 MHz
> available frequency steps: 998 MHz, 732 MHz
> available cpufreq governors: powersave, performance
> current policy: frequency should be within 732 MHz and 998 MHz.
> The governor "performance" may decide which
>speed to use
> within this range.
> current CPU frequency is 998 MHz.
>
>Some stats while switching from the 2 available frequencies while
>doing some random compile and/or disk intensive operation:
>
>| min->MAX | MAX->min
>+--------- +---------
>| 709 PM cicles - occurences 1 | 709 PM cicles - occurences 1
>| 710 PM cicles - occurences 1 | 710 PM cicles - occurences 5
>| 711 PM cicles - occurences 3 | 711 PM cicles - occurences 2
>| 712 PM cicles - occurences 2 | 712 PM cicles - occurences 3
>| 713 PM cicles - occurences 9 | 713 PM cicles - occurences 3
>| 714 PM cicles - occurences 1 | 714 PM cicles - occurences 3
>| 715 PM cicles - occurences 4 | 715 PM cicles - occurences 3
>| 716 PM cicles - occurences 5 | 716 PM cicles - occurences 6
>| 717 PM cicles - occurences 5 | 717 PM cicles - occurences 6
>| 718 PM cicles - occurences 2 | 718 PM cicles - occurences 5
>| 719 PM cicles - occurences 6 | 719 PM cicles - occurences 4
>| 720 PM cicles - occurences 1 | 720 PM cicles - occurences 2
>| 721 PM cicles - occurences 3 | 721 PM cicles - occurences 1
>| 722 PM cicles - occurences 4 | 722 PM cicles - occurences 4
>| 723 PM cicles - occurences 1 | 723 PM cicles - occurences 2
>| 724 PM cicles - occurences 3 | 724 PM cicles - occurences 1
>
>PM cicles weighted average: 716.412
>TSC cicles weighted average: 6009.422
>
>(you don't want to see the perl script that generated it) :)
>
>> Now back to the original problem, from those measurements,
>which time
>> should we put as the maximal transition latency for
>speedstep-ich? Do
>> you think we can simply put something like 300us and that's
>it? Maybe we
>
>I just build speedstep-ich with transition_latency = 250
>I'll let you know how it goes. Are you interested?
>
>> could distinguish between PIII and P4 ? It would require someone to
>> rerun the measurement on a P4 hardware. Do we need to take
>into account
>> as a parameter the CPU frequency?
>
>Maybe it's already been discussed, but how bad would be trying to
>measure transition latency at runtime?
>
Yes. I was thinking the same thing. As this latency may be different on P3-M and P4-M, may be we can do with a measurement at boot time and use it, rather than hardcoding these values. However, I think we will have to do that by using gettimeofday or some such higherlevel call instead of using pmtimer as pmtimer may not be available on all systems at all times. Otherwise, we may end up all sort of pmtimer/pit/hpet timer code in this driver.
Thanks,
Venki
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] transition latency of speedstep-ich (third try)
2005-11-28 22:19 [PATCH] transition latency of speedstep-ich (third try) Pallipadi, Venkatesh
@ 2005-11-28 23:35 ` Eric Piel
2005-11-28 23:48 ` Mattia Dongili
0 siblings, 1 reply; 13+ messages in thread
From: Eric Piel @ 2005-11-28 23:35 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: cpufreq, Dominik Brodowski, davej
28.11.2005 23:19, Pallipadi, Venkatesh wrote/a écrit:
>>-----Original Message-----
>>From: Mattia Dongili [mailto:malattia@linux.it]
>>
>>I just build speedstep-ich with transition_latency = 250
>>I'll let you know how it goes. Are you interested?
Actually, the ondemand governor is quite safe on this side and multiply
this value by 1000, so it shouldn't bring any problem anyway :-)
>>Maybe it's already been discussed, but how bad would be trying to
>>measure transition latency at runtime?
>>
>
>
>
> Yes. I was thinking the same thing. As this latency may be different on P3-M and P4-M, may be we can do with a measurement at boot time and use it, rather than hardcoding these values. However, I think we will have to do that by using gettimeofday or some such higherlevel call instead of using pmtimer as pmtimer may not be available on all systems at all times. Otherwise, we may end up all sort of pmtimer/pit/hpet timer code in this driver.
>
Sounds interesting :-) Especially as speedstep-ich already does at least
2 frequency transitions while initialising, it should be fairly easy to
implement. I'm more concerned about the time measurement. What could be
done is to use gettimeofday() and check that the result is reasonable
(not too big nor too small), if it's not we just put something
conservative, like 500us.
Eric
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] transition latency of speedstep-ich (third try)
2005-11-28 23:35 ` Eric Piel
@ 2005-11-28 23:48 ` Mattia Dongili
2005-11-29 7:48 ` Mattia Dongili
0 siblings, 1 reply; 13+ messages in thread
From: Mattia Dongili @ 2005-11-28 23:48 UTC (permalink / raw)
To: Eric Piel; +Cc: davej, cpufreq, Dominik Brodowski
[-- Attachment #1: Type: text/plain, Size: 2744 bytes --]
On Tue, Nov 29, 2005 at 12:35:07AM +0100, Eric Piel wrote:
> 28.11.2005 23:19, Pallipadi, Venkatesh wrote/a écrit:
> >>-----Original Message-----
> >>From: Mattia Dongili [mailto:malattia@linux.it]
> >>
> >>I just build speedstep-ich with transition_latency = 250
> >>I'll let you know how it goes. Are you interested?
> Actually, the ondemand governor is quite safe on this side and multiply
> this value by 1000, so it shouldn't bring any problem anyway :-)
it's running nicely right now with 250, so I'll keep it by now.
> >>Maybe it's already been discussed, but how bad would be trying to
> >>measure transition latency at runtime?
> >>
> >
> >
> >
> >Yes. I was thinking the same thing. As this latency may be different on
> >P3-M and P4-M, may be we can do with a measurement at boot time and use
> >it, rather than hardcoding these values. However, I think we will have to
> >do that by using gettimeofday or some such higherlevel call instead of
> >using pmtimer as pmtimer may not be available on all systems at all times.
> >Otherwise, we may end up all sort of pmtimer/pit/hpet timer code in this
> >driver.
> >
> Sounds interesting :-) Especially as speedstep-ich already does at least
> 2 frequency transitions while initialising, it should be fairly easy to
> implement. I'm more concerned about the time measurement. What could be
> done is to use gettimeofday() and check that the result is reasonable
> (not too big nor too small), if it's not we just put something
> conservative, like 500us.
this is with do_gettimeofday (code I'm using is attached, oh it's
incremental against your patch and I also left some unused code behind):
cpufreq transition took 202 usec from gettimeofday
cpufreq transition took 200 usec from gettimeofday
cpufreq transition took 203 usec from gettimeofday
cpufreq transition took 200 usec from gettimeofday
cpufreq transition took 202 usec from gettimeofday
cpufreq transition took 199 usec from gettimeofday
cpufreq transition took 199 usec from gettimeofday
cpufreq transition took 199 usec from gettimeofday
cpufreq transition took 200 usec from gettimeofday
cpufreq transition took 199 usec from gettimeofday
cpufreq transition took 198 usec from gettimeofday
cpufreq transition took 201 usec from gettimeofday
cpufreq transition took 202 usec from gettimeofday
cpufreq transition took 199 usec from gettimeofday
cpufreq transition took 202 usec from gettimeofday
cpufreq transition took 198 usec from gettimeofday
cpufreq transition took 201 usec from gettimeofday
it seems reliable wrt values I got with PM timer.
Anyway I also agree with binding resulting measurements to some
reasonable value.
--
mattia
:wq!
[-- Attachment #2: speedstep-ich-gettimeofday.diff --]
[-- Type: text/plain, Size: 1616 bytes --]
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
index 3c84a9b..f54c5c5 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
@@ -24,6 +24,7 @@
#include <linux/cpufreq.h>
#include <linux/pci.h>
#include <linux/slab.h>
+#include <linux/time.h>
#include "speedstep-lib.h"
@@ -93,8 +94,7 @@ static void speedstep_set_state (unsigne
u8 pm2_blk;
u8 value;
unsigned long flags;
- unsigned long long tsc1, tsc2;
- u32 pmt1, pmt2;
+ struct timeval t1, t2;
if (!speedstep_chipset_dev || (state > 0x1))
return;
@@ -115,8 +115,7 @@ static void speedstep_set_state (unsigne
/* Disable IRQs */
local_irq_save(flags);
- rdtscll(tsc1);
- pmt1 = read_pmtmr();
+ do_gettimeofday(&t1);
/* read state */
value = inb(pmbase + 0x50);
@@ -144,8 +143,7 @@ static void speedstep_set_state (unsigne
/* check if transition was successful */
value = inb(pmbase + 0x50);
- rdtscll(tsc2);
- pmt2 = read_pmtmr();
+ do_gettimeofday(&t2);
/* Enable IRQs */
local_irq_restore(flags);
@@ -158,8 +156,13 @@ static void speedstep_set_state (unsigne
printk (KERN_ERR "cpufreq: change failed - I/O error\n");
}
- printk(KERN_ERR "cpufreq transition took %llu TSC cycles\n", tsc2 - tsc1);
- printk(KERN_ERR "cpufreq transition took %u PM timer cycles\n", pmt2 - pmt1);
+ {
+
+ long long diff = (t2.tv_sec * MSEC_PER_SEC + t2.tv_usec) -
+ (t1.tv_sec * MSEC_PER_SEC + t1.tv_usec);
+ printk(KERN_ERR "cpufreq transition took %lld usec from gettimeofday\n", diff);
+
+ }
return;
}
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH] transition latency of speedstep-ich (third try)
2005-11-28 23:48 ` Mattia Dongili
@ 2005-11-29 7:48 ` Mattia Dongili
0 siblings, 0 replies; 13+ messages in thread
From: Mattia Dongili @ 2005-11-29 7:48 UTC (permalink / raw)
To: Mattia Dongili; +Cc: davej, Eric Piel, Dominik Brodowski, cpufreq
On Tue, November 29, 2005 12:48 am, Mattia Dongili said:
[...]
> + long long diff = (t2.tv_sec * MSEC_PER_SEC + t2.tv_usec) -
> + (t1.tv_sec * MSEC_PER_SEC + t1.tv_usec);
doh... as the name suggests it should really be USEC_PER_SEC...
--
mattia
:wq!
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH] transition latency of speedstep-ich (third try)
@ 2005-10-05 20:39 Pallipadi, Venkatesh
2005-11-26 22:40 ` Eric Piel
0 siblings, 1 reply; 13+ messages in thread
From: Pallipadi, Venkatesh @ 2005-10-05 20:39 UTC (permalink / raw)
To: Eric Piel; +Cc: davej, Dominik Brodowski, cpufreq
>-----Original Message-----
>From: Eric Piel [mailto:Eric.Piel@tremplin-utc.net]
>Sent: Thursday, September 29, 2005 3:06 PM
>>>
>>>As it's very different from the numbers you got, I wonder if
>I mistook
>>>somewhere ?
>>>
>>
>>
>> I don't have any numbers with Coppermine or P4-M. Probably the reason
>> For low numbers is TSC itself stops at certain times during
>this whole
>> Operation. And it will also run at slower frequency once you
>change the
>> Freq (On coppermine). 6uS is too low in my opinion. We may not be
>> measuring correctly here.
>Could it happen that on a P4M the TSC doesn't stop? Then maybe someone
>with such a harware could try? Otherwise, what do you suggest
>to obtain
>the maximum transition latency? Take 500uS and multiply by the
>number of
>I/O in the code ?
>
>Eric
>
Do you have ACPI PM timer on your system? May be we can measure the
latency using that.
Thanks,
Venki
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] transition latency of speedstep-ich (third try)
2005-10-05 20:39 Pallipadi, Venkatesh
@ 2005-11-26 22:40 ` Eric Piel
2005-11-28 22:12 ` Mattia Dongili
0 siblings, 1 reply; 13+ messages in thread
From: Eric Piel @ 2005-11-26 22:40 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: davej, Dominik Brodowski, cpufreq
[-- Attachment #1: Type: text/plain, Size: 2213 bytes --]
05.10.2005 22:39, Pallipadi, Venkatesh wrote/a écrit:
>>-----Original Message-----
>>From: Eric Piel [mailto:Eric.Piel@tremplin-utc.net]
>>Sent: Thursday, September 29, 2005 3:06 PM
>>
>>>>As it's very different from the numbers you got, I wonder if
>>
>>I mistook
>>
>>>>somewhere ?
>>>>
>>>
>>>
>>>I don't have any numbers with Coppermine or P4-M. Probably the reason
>>>For low numbers is TSC itself stops at certain times during
>>
>>this whole
>>
>>>Operation. And it will also run at slower frequency once you
>>
>>change the
>>
>>>Freq (On coppermine). 6uS is too low in my opinion. We may not be
>>>measuring correctly here.
>>
>>Could it happen that on a P4M the TSC doesn't stop? Then maybe someone
>>with such a harware could try? Otherwise, what do you suggest
>>to obtain
>>the maximum transition latency? Take 500uS and multiply by the
>>number of
>>I/O in the code ?
>>
>>Eric
>>
>
>
> Do you have ACPI PM timer on your system? May be we can measure the
> latency using that.
>
Hello,
Sorry for the looonnnggg delay of the reply. I've finally found time to
hunt for the PM timer on my computer, found it, and kludged
speedstep-ich to read it :-) For verification and completeness, the
patch is attached. (the PM timer address is hard-coded, it has to be
changed before running it on another system, it's indicated at boot in
dmesg).
So the results are quite interesting and confirm your expectations,
Venki. After few hours with the ondemand governor, I checked the logs
and the transition latency seems very stable: around 735 to 742 PM timer
ticks (~206 us). So indeed, 100us of transition latency was quite
under-estimating it!
Now back to the original problem, from those measurements, which time
should we put as the maximal transition latency for speedstep-ich? Do
you think we can simply put something like 300us and that's it? Maybe we
could distinguish between PIII and P4 ? It would require someone to
rerun the measurement on a P4 hardware. Do we need to take into account
as a parameter the CPU frequency?
Hoping we can finally get the ondemand governor working with speedstep-ich!
Eric
[-- Attachment #2: speedstep-ich-measure-transition-2.6.14.patch --]
[-- Type: text/x-patch, Size: 2180 bytes --]
--- linux-2.6.14.bak/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c 2005-11-06 14:50:34.000000000 +0100
+++ linux-2.6.14/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c 2005-11-26 22:26:28.000000000 +0100
@@ -55,6 +55,32 @@ static struct cpufreq_frequency_table sp
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-ich", msg)
+/* from timer_pm.c */
+u32 pmtmr_ioport = 0x1008; // from dmesg , to avoid having to export it
+
+#define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */
+
+/*helper function to safely read acpi pm timesource*/
+static inline u32 read_pmtmr(void)
+{
+ u32 v1=0,v2=0,v3=0;
+ /* It has been reported that because of various broken
+ * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time
+ * source is not latched, so you must read it multiple
+ * times to insure a safe value is read.
+ */
+ do {
+ v1 = inl(pmtmr_ioport);
+ v2 = inl(pmtmr_ioport);
+ v3 = inl(pmtmr_ioport);
+ } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1)
+ || (v3 > v1 && v3 < v2));
+
+ /* mask the output to 24 bits */
+ return v2 & ACPI_PM_MASK;
+}
+
+
/**
* speedstep_set_state - set the SpeedStep state
* @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
@@ -67,6 +93,8 @@ static void speedstep_set_state (unsigne
u8 pm2_blk;
u8 value;
unsigned long flags;
+ unsigned long long tsc1, tsc2;
+ u32 pmt1, pmt2;
if (!speedstep_chipset_dev || (state > 0x1))
return;
@@ -87,6 +115,9 @@ static void speedstep_set_state (unsigne
/* Disable IRQs */
local_irq_save(flags);
+ rdtscll(tsc1);
+ pmt1 = read_pmtmr();
+
/* read state */
value = inb(pmbase + 0x50);
@@ -112,6 +143,9 @@ static void speedstep_set_state (unsigne
/* check if transition was successful */
value = inb(pmbase + 0x50);
+
+ rdtscll(tsc2);
+ pmt2 = read_pmtmr();
/* Enable IRQs */
local_irq_restore(flags);
@@ -124,6 +158,8 @@ static void speedstep_set_state (unsigne
printk (KERN_ERR "cpufreq: change failed - I/O error\n");
}
+ printk(KERN_ERR "cpufreq transition took %llu TSC cycles\n", tsc2 - tsc1);
+ printk(KERN_ERR "cpufreq transition took %u PM timer cycles\n", pmt2 - pmt1);
return;
}
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH] transition latency of speedstep-ich (third try)
2005-11-26 22:40 ` Eric Piel
@ 2005-11-28 22:12 ` Mattia Dongili
0 siblings, 0 replies; 13+ messages in thread
From: Mattia Dongili @ 2005-11-28 22:12 UTC (permalink / raw)
To: Eric Piel; +Cc: davej, cpufreq, Dominik Brodowski
On Sat, Nov 26, 2005 at 11:40:20PM +0100, Eric Piel wrote:
> 05.10.2005 22:39, Pallipadi, Venkatesh wrote/a écrit:
[...]
> >Do you have ACPI PM timer on your system? May be we can measure the
> >latency using that.
> >
> Hello,
>
> Sorry for the looonnnggg delay of the reply. I've finally found time to
> hunt for the PM timer on my computer, found it, and kludged
> speedstep-ich to read it :-) For verification and completeness, the
> patch is attached. (the PM timer address is hard-coded, it has to be
> changed before running it on another system, it's indicated at boot in
> dmesg).
>
> So the results are quite interesting and confirm your expectations,
> Venki. After few hours with the ondemand governor, I checked the logs
> and the transition latency seems very stable: around 735 to 742 PM timer
> ticks (~206 us). So indeed, 100us of transition latency was quite
> under-estimating it!
So here's some measurement on my P3M (seems a little faster than yours
in switching):
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 11
model name : Intel(R) Pentium(R) III Mobile CPU 1000MHz
stepping : 1
cpu MHz : 994.394
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips : 1991.49
cpufrequtils 0.3: cpufreq-info (C) Dominik Brodowski 2004
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
driver: speedstep-ich
CPUs which need to switch frequency at the same time: 0
hardware limits: 732 MHz - 998 MHz
available frequency steps: 998 MHz, 732 MHz
available cpufreq governors: powersave, performance
current policy: frequency should be within 732 MHz and 998 MHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 998 MHz.
Some stats while switching from the 2 available frequencies while
doing some random compile and/or disk intensive operation:
| min->MAX | MAX->min
+--------- +---------
| 709 PM cicles - occurences 1 | 709 PM cicles - occurences 1
| 710 PM cicles - occurences 1 | 710 PM cicles - occurences 5
| 711 PM cicles - occurences 3 | 711 PM cicles - occurences 2
| 712 PM cicles - occurences 2 | 712 PM cicles - occurences 3
| 713 PM cicles - occurences 9 | 713 PM cicles - occurences 3
| 714 PM cicles - occurences 1 | 714 PM cicles - occurences 3
| 715 PM cicles - occurences 4 | 715 PM cicles - occurences 3
| 716 PM cicles - occurences 5 | 716 PM cicles - occurences 6
| 717 PM cicles - occurences 5 | 717 PM cicles - occurences 6
| 718 PM cicles - occurences 2 | 718 PM cicles - occurences 5
| 719 PM cicles - occurences 6 | 719 PM cicles - occurences 4
| 720 PM cicles - occurences 1 | 720 PM cicles - occurences 2
| 721 PM cicles - occurences 3 | 721 PM cicles - occurences 1
| 722 PM cicles - occurences 4 | 722 PM cicles - occurences 4
| 723 PM cicles - occurences 1 | 723 PM cicles - occurences 2
| 724 PM cicles - occurences 3 | 724 PM cicles - occurences 1
PM cicles weighted average: 716.412
TSC cicles weighted average: 6009.422
(you don't want to see the perl script that generated it) :)
> Now back to the original problem, from those measurements, which time
> should we put as the maximal transition latency for speedstep-ich? Do
> you think we can simply put something like 300us and that's it? Maybe we
I just build speedstep-ich with transition_latency = 250
I'll let you know how it goes. Are you interested?
> could distinguish between PIII and P4 ? It would require someone to
> rerun the measurement on a P4 hardware. Do we need to take into account
> as a parameter the CPU frequency?
Maybe it's already been discussed, but how bad would be trying to
measure transition latency at runtime?
--
mattia
:wq!
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH] transition latency of speedstep-ich (third try)
@ 2005-09-28 23:53 Pallipadi, Venkatesh
2005-09-29 22:06 ` Eric Piel
0 siblings, 1 reply; 13+ messages in thread
From: Pallipadi, Venkatesh @ 2005-09-28 23:53 UTC (permalink / raw)
To: Eric Piel; +Cc: davej, Dominik Brodowski, cpufreq
>-----Original Message-----
>From: Eric Piel [mailto:Eric.Piel@tremplin-utc.net]
>> Eric,
>> Can you put rdtsc's around these in/out on your system and
>check how long do they really take. On P4M, rdtsc should be
>running all the time other than the Cpu being in deep_sleep
>state. That should give us some idea about the SMM latency.
>>
>Ok, I've just done it. It's on a P3 coppermine though (not a P4M). So
>I've measure the difference of tsc before and after the in/out
>instructions (not included the local_irq_*()). The patch is
>attached for
>double check (or if someone wants to try on another CPU). The values
>seem very small compare to the 500uS you mentioned.
>
>After few minutes with ondemand governor, there was a log like this:
>Sep 28 23:30:32 circle kernel: cpufreq transition took 4862 cycles
>Sep 28 23:30:33 circle kernel: cpufreq transition took 4473 cycles
>Sep 28 23:30:33 circle kernel: cpufreq transition took 4836 cycles
>Sep 28 23:30:35 circle kernel: cpufreq transition took 4723 cycles
>Sep 28 23:30:35 circle kernel: cpufreq transition took 5640 cycles
>Sep 28 23:30:48 circle kernel: cpufreq transition took 4515 cycles
>Sep 28 23:30:48 circle kernel: cpufreq transition took 4904 cycles
>Sep 28 23:31:02 circle kernel: cpufreq transition took 4286 cycles
>Sep 28 23:31:02 circle kernel: cpufreq transition took 4607 cycles
>Sep 28 23:31:03 circle kernel: cpufreq transition took 4279 cycles
>Sep 28 23:31:03 circle kernel: cpufreq transition took 4605 cycles
>Sep 28 23:31:04 circle kernel: cpufreq transition took 4694 cycles
>Sep 28 23:31:04 circle kernel: cpufreq transition took 4605 cycles
>Sep 28 23:31:13 circle kernel: cpufreq transition took 4683 cycles
>Sep 28 23:31:14 circle kernel: cpufreq transition took 4676 cycles
>Sep 28 23:31:14 circle kernel: cpufreq transition took 4515 cycles
>Sep 28 23:31:15 circle kernel: cpufreq transition took 4522 cycles
>
>Maximum I've seen is 5640 cycles, minimum is about 4200c. My CPU is
>clocked 1GHz so the result can be easily summarized to a maximum of
>about 6uS.
>
>As it's very different from the numbers you got, I wonder if I mistook
>somewhere ?
>
I don't have any numbers with Coppermine or P4-M. Probably the reason
For low numbers is TSC itself stops at certain times during this whole
Operation. And it will also run at slower frequency once you change the
Freq (On coppermine). 6uS is too low in my opinion. We may not be
measuring correctly here.
Thanks,
Venki
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] transition latency of speedstep-ich (third try)
2005-09-28 23:53 Pallipadi, Venkatesh
@ 2005-09-29 22:06 ` Eric Piel
2005-10-14 15:19 ` Stefan Seyfried
0 siblings, 1 reply; 13+ messages in thread
From: Eric Piel @ 2005-09-29 22:06 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: davej, Dominik Brodowski, cpufreq
29.09.2005 01:53, Pallipadi, Venkatesh wrote/a écrit:
>>-----Original Message-----
>>From: Eric Piel [mailto:Eric.Piel@tremplin-utc.net]
>>
>>>Eric,
>>>Can you put rdtsc's around these in/out on your system and
>>
>>check how long do they really take. On P4M, rdtsc should be
>>running all the time other than the Cpu being in deep_sleep
>>state. That should give us some idea about the SMM latency.
>>
>>Ok, I've just done it. It's on a P3 coppermine though (not a P4M). So
>>I've measure the difference of tsc before and after the in/out
>>instructions (not included the local_irq_*()). The patch is
>>attached for
>>double check (or if someone wants to try on another CPU). The values
>>seem very small compare to the 500uS you mentioned.
>>
>>After few minutes with ondemand governor, there was a log like this:
>>Sep 28 23:30:32 circle kernel: cpufreq transition took 4862 cycles
>>Sep 28 23:30:33 circle kernel: cpufreq transition took 4473 cycles
>>Sep 28 23:30:33 circle kernel: cpufreq transition took 4836 cycles
>>Sep 28 23:30:35 circle kernel: cpufreq transition took 4723 cycles
>>Sep 28 23:30:35 circle kernel: cpufreq transition took 5640 cycles
>>Sep 28 23:30:48 circle kernel: cpufreq transition took 4515 cycles
>>Sep 28 23:30:48 circle kernel: cpufreq transition took 4904 cycles
>>Sep 28 23:31:02 circle kernel: cpufreq transition took 4286 cycles
>>Sep 28 23:31:02 circle kernel: cpufreq transition took 4607 cycles
>>Sep 28 23:31:03 circle kernel: cpufreq transition took 4279 cycles
>>Sep 28 23:31:03 circle kernel: cpufreq transition took 4605 cycles
>>Sep 28 23:31:04 circle kernel: cpufreq transition took 4694 cycles
>>Sep 28 23:31:04 circle kernel: cpufreq transition took 4605 cycles
>>Sep 28 23:31:13 circle kernel: cpufreq transition took 4683 cycles
>>Sep 28 23:31:14 circle kernel: cpufreq transition took 4676 cycles
>>Sep 28 23:31:14 circle kernel: cpufreq transition took 4515 cycles
>>Sep 28 23:31:15 circle kernel: cpufreq transition took 4522 cycles
>>
>>Maximum I've seen is 5640 cycles, minimum is about 4200c. My CPU is
>>clocked 1GHz so the result can be easily summarized to a maximum of
>>about 6uS.
>>
>>As it's very different from the numbers you got, I wonder if I mistook
>>somewhere ?
>>
>
>
> I don't have any numbers with Coppermine or P4-M. Probably the reason
> For low numbers is TSC itself stops at certain times during this whole
> Operation. And it will also run at slower frequency once you change the
> Freq (On coppermine). 6uS is too low in my opinion. We may not be
> measuring correctly here.
Could it happen that on a P4M the TSC doesn't stop? Then maybe someone
with such a harware could try? Otherwise, what do you suggest to obtain
the maximum transition latency? Take 500uS and multiply by the number of
I/O in the code ?
Eric
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] transition latency of speedstep-ich (third try)
2005-09-29 22:06 ` Eric Piel
@ 2005-10-14 15:19 ` Stefan Seyfried
0 siblings, 0 replies; 13+ messages in thread
From: Stefan Seyfried @ 2005-10-14 15:19 UTC (permalink / raw)
To: Eric Piel; +Cc: davej, Stefan Seyfried, Dominik Brodowski, cpufreq
Sorry for coming in late...
On Fri, Sep 30, 2005 at 12:06:14AM +0200, Eric Piel wrote:
> Could it happen that on a P4M the TSC doesn't stop? Then maybe someone
> with such a harware could try?
i have P4M Hardware at hand (Thinkpads T30, A30, R32) but am on vacation
next week.
If someone pings me on this after 24.october, i might not forget it :-)
I am very interested in getting the latencies down to get rid of the
userspace governor in the powersave daemon (less code to maintain, and
maintained by our kernel guys and not me ;-)
--
Stefan Seyfried
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH] transition latency of speedstep-ich (third try)
@ 2005-09-28 1:26 Pallipadi, Venkatesh
2005-09-28 21:38 ` Eric Piel
0 siblings, 1 reply; 13+ messages in thread
From: Pallipadi, Venkatesh @ 2005-09-28 1:26 UTC (permalink / raw)
To: Eric Piel; +Cc: davej, Dominik Brodowski, cpufreq
Great work! Getting those useful numbers form those documents :).
I think the 100uS and 50uS looks proper from what the documents describe. However, there is one factor that we are missing though. Speedstep-ich uses IO ports to initiate these transitions. Right? These IO port accesses trap into BIOS code which actually initiaites the trasntion. And this trap into BIOS code happens through SMM. And whenvever SMM's are involved I have seen latencies of upto 500uS! And in speedstep_ich:speedstep_set_state(), I see more than one in/out instructions. So, it can easily be higher than this.
I think we need to add a guestimate for SMM latency number as well.
Eric,
Can you put rdtsc's around these in/out on your system and check how long do they really take. On P4M, rdtsc should be running all the time other than the Cpu being in deep_sleep state. That should give us some idea about the SMM latency.
Thanks,
Venki
>-----Original Message-----
>From: Eric Piel [mailto:Eric.Piel@tremplin-utc.net]
>Sent: Monday, September 19, 2005 3:35 PM
>To: Pallipadi, Venkatesh
>Cc: Dominik Brodowski; davej@redhat.com; cpufreq@lists.linux.org.uk
>Subject: Re: [PATCH] transition latency of speedstep-ich (third try)
>
>19.09.2005 12:18, Dominik Brodowski wrote/a écrit:
>> Hi,
>>
>> On Sun, Sep 18, 2005 at 11:15:09PM +0200, Eric Piel wrote:
>>
>>>Here is my third try to get speedstep-ich compatible with
>the ondemand
>>>governor. Taking into account the comments of Dominik I've
>gone through
>>>the intel documentation in order to get the transition
>latency depending
>>>on the processor.
>>
>> Thanks for doing so!
>>
>>
>>>+ case SPEEDSTEP_PROCESSOR_PIII_T:
>>>+ /* Max 100??s, according to intel's 29834006.pdf p.22 */
>>
>> ^^
>> The greek sign in microsecond can't be printed well, so I
>suggest you use
>> "us" instead.
>>
>>
>>>+ * Max ~42??s -> 50??s, according to intel's
>25068607.pdf p.40 and p.50
>>
>> ^^ ^^
>> same here.
>Ok, sorry, just forgot it was not an ASCII character (even xterm
>supports UTF-8 nowadays ;-) ). I'll resend as soon as I get the answer
>from Venki.
>
>> Other than that, it'd be great if you, Venki, could take a
>look at the
>> technical side of this. Because of the cpufreq list still
>being down, I
>> attached the message in full below.
>Indeed, Venki, I would be extremely thanksfull if you could validate
>those numbers. To sum up, could you confirm that the
>transition latency
>between two frequencies never exeeds:
>* 100us for Coppermine and Tualatin
>* 50us for Pentium 4 M
>
>Cheers
>Eric
>
>
>
>>
>>>While for the centrino processors such information is
>clearly written,
>>>this was not the case for the processors managed by
>speedstep-ich. I did
>>>my best to understand the electrical timing descriptions and
>the results
>>>look realistic, but I can't guaranty 100% certainty. At
>least, the code
>>>hasn't destroyed my pentium coppermine yet ;-)
>>>
>>>It's against 2.6.13, hope you like it...
>>>
>>>Eric
>>>
>>>--
>>>Set the transition latency of speedstep-ich depending on the
>processor,
>>>using information taken from intel's manuals.
>>>
>>>Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
>>>--
>>
>>
>>>---
>linux-2.6.13/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c.bak
>2005-08-08 10:14:35.000000000 +0200
>>>+++
>linux-2.6.13/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
>2005-09-17 12:50:27.000000000 +0200
>>>@@ -301,6 +301,35 @@ static int speedstep_verify (struct cpuf
>>> }
>>>
>>>
>>>+/**
>>>+ * speedstep_get_transition_latency - returns the maximum
>transition latency
>>>+ * of the current processor
>>>+ * @processor: type of processor
>>>+ *
>>>+ * The CPU transition latency depends on the type of CPU,
>so we get it
>>>+ * from a database.
>>>+ */
>>>+static unsigned int
>speedstep_get_transition_latency(unsigned int processor)
>>>+{
>>>+ switch (processor) {
>>>+ case SPEEDSTEP_PROCESSOR_PIII_C:
>>>+ case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:
>>>+ /* According to intel's p3_ds.pdf p.23 and
>table 22, similar to PIII_T */
>>>+ case SPEEDSTEP_PROCESSOR_PIII_T:
>>>+ /* Max 100??s, according to intel's 29834006.pdf p.22 */
>>>+ return 100000;
>>>+ case SPEEDSTEP_PROCESSOR_P4M:
>>>+ /*
>>>+ * Depends on the bus clock, which should be at
>least 100MHz.
>>>+ * Max ~42??s -> 50??s, according to intel's
>25068607.pdf p.40 and p.50
>>>+ */
>>>+ return 50000;
>>>+ default:
>>>+ /* No info has yet be found, so we are conservative */
>>>+ return CPUFREQ_ETERNAL;
>>>+ }
>>>+}
>>>+
>>> static int speedstep_cpu_init(struct cpufreq_policy *policy)
>>> {
>>> int result = 0;
>>>@@ -335,7 +364,8 @@ static int speedstep_cpu_init(struct cpu
>>>
>>> /* cpuinfo and default policy values */
>>> policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
>>>- policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
>>>+ policy->cpuinfo.transition_latency =
>>>+ speedstep_get_transition_latency(speedstep_processor);
>>> policy->cur = speed;
>>>
>>> result = cpufreq_frequency_table_cpuinfo(policy,
>speedstep_freqs);
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH] transition latency of speedstep-ich (third try)
2005-09-28 1:26 Pallipadi, Venkatesh
@ 2005-09-28 21:38 ` Eric Piel
0 siblings, 0 replies; 13+ messages in thread
From: Eric Piel @ 2005-09-28 21:38 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: davej, Dominik Brodowski, cpufreq
[-- Attachment #1: Type: text/plain, Size: 2917 bytes --]
28.09.2005 03:26, Pallipadi, Venkatesh wrote/a écrit:
>
> Great work! Getting those useful numbers form those documents :).
>
> I think the 100uS and 50uS looks proper from what the documents describe. However, there is one factor that we are missing though. Speedstep-ich uses IO ports to initiate these transitions. Right? These IO port accesses trap into BIOS code which actually initiaites the trasntion. And this trap into BIOS code happens through SMM. And whenvever SMM's are involved I have seen latencies of upto 500uS! And in speedstep_ich:speedstep_set_state(), I see more than one in/out instructions. So, it can easily be higher than this.
It's great to know that I've managed to read in between the line of the
intel documents succesfully ;-)
>
> I think we need to add a guestimate for SMM latency number as well.
>
> Eric,
> Can you put rdtsc's around these in/out on your system and check how long do they really take. On P4M, rdtsc should be running all the time other than the Cpu being in deep_sleep state. That should give us some idea about the SMM latency.
>
Ok, I've just done it. It's on a P3 coppermine though (not a P4M). So
I've measure the difference of tsc before and after the in/out
instructions (not included the local_irq_*()). The patch is attached for
double check (or if someone wants to try on another CPU). The values
seem very small compare to the 500uS you mentioned.
After few minutes with ondemand governor, there was a log like this:
Sep 28 23:30:32 circle kernel: cpufreq transition took 4862 cycles
Sep 28 23:30:33 circle kernel: cpufreq transition took 4473 cycles
Sep 28 23:30:33 circle kernel: cpufreq transition took 4836 cycles
Sep 28 23:30:35 circle kernel: cpufreq transition took 4723 cycles
Sep 28 23:30:35 circle kernel: cpufreq transition took 5640 cycles
Sep 28 23:30:48 circle kernel: cpufreq transition took 4515 cycles
Sep 28 23:30:48 circle kernel: cpufreq transition took 4904 cycles
Sep 28 23:31:02 circle kernel: cpufreq transition took 4286 cycles
Sep 28 23:31:02 circle kernel: cpufreq transition took 4607 cycles
Sep 28 23:31:03 circle kernel: cpufreq transition took 4279 cycles
Sep 28 23:31:03 circle kernel: cpufreq transition took 4605 cycles
Sep 28 23:31:04 circle kernel: cpufreq transition took 4694 cycles
Sep 28 23:31:04 circle kernel: cpufreq transition took 4605 cycles
Sep 28 23:31:13 circle kernel: cpufreq transition took 4683 cycles
Sep 28 23:31:14 circle kernel: cpufreq transition took 4676 cycles
Sep 28 23:31:14 circle kernel: cpufreq transition took 4515 cycles
Sep 28 23:31:15 circle kernel: cpufreq transition took 4522 cycles
Maximum I've seen is 5640 cycles, minimum is about 4200c. My CPU is
clocked 1GHz so the result can be easily summarized to a maximum of
about 6uS.
As it's very different from the numbers you got, I wonder if I mistook
somewhere ?
Eric
[-- Attachment #2: speedstep-ich-measure-transition-2.6.13.patch --]
[-- Type: text/x-patch, Size: 981 bytes --]
--- arch/i386/kernel/cpu/cpufreq/speedstep-ich.c-beforetsc 2005-09-28 23:23:49.000000000 +0200
+++ arch/i386/kernel/cpu/cpufreq/speedstep-ich.c 2005-09-28 23:23:18.000000000 +0200
@@ -66,6 +66,7 @@ static void speedstep_set_state (unsigne
u8 pm2_blk;
u8 value;
unsigned long flags;
+ unsigned long long tsc1, tsc2;
if (!speedstep_chipset_dev || (state > 0x1))
return;
@@ -86,6 +87,8 @@ static void speedstep_set_state (unsigne
/* Disable IRQs */
local_irq_save(flags);
+ rdtscll(tsc1);
+
/* read state */
value = inb(pmbase + 0x50);
@@ -111,6 +114,8 @@ static void speedstep_set_state (unsigne
/* check if transition was successful */
value = inb(pmbase + 0x50);
+
+ rdtscll(tsc2);
/* Enable IRQs */
local_irq_restore(flags);
@@ -123,6 +128,7 @@ static void speedstep_set_state (unsigne
printk (KERN_ERR "cpufreq: change failed - I/O error\n");
}
+ printk(KERN_ERR "cpufreq transition took %llu cycles\n", tsc2 - tsc1);
return;
}
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] support for CPUFREQ_ETERNAL drivers by the ondemand governor
@ 2005-02-06 22:33 Eric Piel
2005-02-09 19:15 ` Dominik Brodowski
0 siblings, 1 reply; 13+ messages in thread
From: Eric Piel @ 2005-02-06 22:33 UTC (permalink / raw)
To: Venkatesh Pallipadi, Jun Nakajima; +Cc: cpufreq
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
Hello,
For now the ondemand governor doesn't support the drivers which reports
a transition latency of CPUFREQ_ETERNAL. That's really a problem because
most of the drivers declare such a latency (simply because it's not
known, not really because the transition will take an eternal time).
All userspace daemons suport those drivers, they just don't pay
attention to the transition latency.
This patch proposes to consider a CPUFREQ_ETERNAL latency as the maximum
possible latency of the governor (10 ms). I think this should be
conservative enough to be safe with any driver.
Hoping you like it,
Eric
--
Support for CPUFREQ_ETERNAL drivers by the ondemand governor.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
--
[-- Attachment #2: ondemand-accept-eternel-transition-latency-2.6.11-rc3.patch --]
[-- Type: text/x-patch, Size: 1345 bytes --]
--- linux-2.6.11-rc3/drivers/cpufreq/cpufreq_ondemand.c.orig 2005-02-05 17:09:30.000000000 +0100
+++ linux-2.6.11-rc3/drivers/cpufreq/cpufreq_ondemand.c 2005-02-05 18:02:55.000000000 +0100
@@ -56,7 +56,7 @@ static unsigned int def_sampling_rat
#define MAX_SAMPLING_RATE (500 * def_sampling_rate)
#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
#define DEF_SAMPLING_DOWN_FACTOR (10)
-#define TRANSITION_LATENCY_LIMIT (10 * 1000)
+#define TRANSITION_LATENCY_LIMIT (10 * 1000 * 1000) /* ns */
#define sampling_rate_in_HZ(x) (((x * HZ) < (1000 * 1000))?1:((x * HZ) / (1000 * 1000)))
static void do_dbs_timer(void *data);
@@ -385,8 +385,8 @@ static int cpufreq_governor_dbs(struct c
(!policy->cur))
return -EINVAL;
- if (policy->cpuinfo.transition_latency >
- (TRANSITION_LATENCY_LIMIT * 1000))
+ if ((policy->cpuinfo.transition_latency > TRANSITION_LATENCY_LIMIT) &&
+ (policy->cpuinfo.transition_latency != CPUFREQ_ETERNAL))
return -EINVAL;
if (this_dbs_info->enable) /* Already enabled */
break;
@@ -416,6 +416,8 @@ static int cpufreq_governor_dbs(struct c
/* policy latency is in nS. Convert it to uS first */
latency = policy->cpuinfo.transition_latency;
+ if (latency == CPUFREQ_ETERNAL)
+ latency = TRANSITION_LATENCY_LIMIT;
if (latency < 1000)
latency = 1000;
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] support for CPUFREQ_ETERNAL drivers by the ondemand governor
2005-02-06 22:33 [PATCH] support for CPUFREQ_ETERNAL drivers by the ondemand governor Eric Piel
@ 2005-02-09 19:15 ` Dominik Brodowski
2005-03-06 17:06 ` [PATCH] transition latency of speedstep-ich Eric Piel
0 siblings, 1 reply; 13+ messages in thread
From: Dominik Brodowski @ 2005-02-09 19:15 UTC (permalink / raw)
To: Eric Piel; +Cc: cpufreq, Jun Nakajima
On Sun, Feb 06, 2005 at 11:33:49PM +0100, Eric Piel wrote:
> Hello,
>
> For now the ondemand governor doesn't support the drivers which reports
> a transition latency of CPUFREQ_ETERNAL. That's really a problem because
> most of the drivers declare such a latency (simply because it's not
> known, not really because the transition will take an eternal time).
> All userspace daemons suport those drivers, they just don't pay
> attention to the transition latency.
>
> This patch proposes to consider a CPUFREQ_ETERNAL latency as the maximum
> possible latency of the governor (10 ms). I think this should be
> conservative enough to be safe with any driver.
No. CPUFREQ_ETERNAL is there to assert no dynamic frequency governor runs
with this driver. If a driver is safe to run on dynamic frequency governors
like ondemand, fix the latency value instead.
Dominik
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] transition latency of speedstep-ich
2005-02-09 19:15 ` Dominik Brodowski
@ 2005-03-06 17:06 ` Eric Piel
[not found] ` <20050307182137.GB24559@isilmar.linta.de>
0 siblings, 1 reply; 13+ messages in thread
From: Eric Piel @ 2005-03-06 17:06 UTC (permalink / raw)
To: Dominik Brodowski; +Cc: cpufreq
[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]
Dominik Brodowski a écrit :
> On Sun, Feb 06, 2005 at 11:33:49PM +0100, Eric Piel wrote:
:
>>This patch proposes to consider a CPUFREQ_ETERNAL latency as the maximum
>>possible latency of the governor (10 ms). I think this should be
>>conservative enough to be safe with any driver.
>
> No. CPUFREQ_ETERNAL is there to assert no dynamic frequency governor runs
> with this driver. If a driver is safe to run on dynamic frequency governors
> like ondemand, fix the latency value instead.
>
OK, so here is a patch for vanilla 2.6.11 to set the transition latency
of speedstep-ich (the only driver which I can test in addtion to
p4-clockmod). Actually it was quite hard to find, the intel manual
(29834006.pdf) doesn't assert this latency clearly. From what I
understood the frequency transition could take up to about 40µs (p.44)
while the voltage transition could take up to 100µs (p.22 and p.58). So
I put 100µs as the transition latency of this driver.
I've tried it on my computer, it works, and the ondemand governor can
now support my hardware!
Hope you like it,
Eric
--
Set the transition latency of speedstep-ich to 100µs as described in
intel's manual.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
--
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: speedstep-ich-transition-latency-2.6.11.patch --]
[-- Type: text/x-patch; name="speedstep-ich-transition-latency-2.6.11.patch", Size: 581 bytes --]
--- linux-2.6.11/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c.orig 2005-02-07 23:52:55.000000000 +0100
+++ linux-2.6.11/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c 2005-03-06 17:51:04.000000000 +0100
@@ -335,7 +335,8 @@
/* cpuinfo and default policy values */
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
+ /* Max 100µs, according to intel's 29834006.pdf p.22 */
+ policy->cpuinfo.transition_latency = 100000;
policy->cur = speed;
result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2005-11-29 7:48 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-28 22:19 [PATCH] transition latency of speedstep-ich (third try) Pallipadi, Venkatesh
2005-11-28 23:35 ` Eric Piel
2005-11-28 23:48 ` Mattia Dongili
2005-11-29 7:48 ` Mattia Dongili
-- strict thread matches above, loose matches on Subject: below --
2005-10-05 20:39 Pallipadi, Venkatesh
2005-11-26 22:40 ` Eric Piel
2005-11-28 22:12 ` Mattia Dongili
2005-09-28 23:53 Pallipadi, Venkatesh
2005-09-29 22:06 ` Eric Piel
2005-10-14 15:19 ` Stefan Seyfried
2005-09-28 1:26 Pallipadi, Venkatesh
2005-09-28 21:38 ` Eric Piel
2005-02-06 22:33 [PATCH] support for CPUFREQ_ETERNAL drivers by the ondemand governor Eric Piel
2005-02-09 19:15 ` Dominik Brodowski
2005-03-06 17:06 ` [PATCH] transition latency of speedstep-ich Eric Piel
[not found] ` <20050307182137.GB24559@isilmar.linta.de>
[not found] ` <432DD8DD.3090805@tremplin-utc.net>
[not found] ` <20050919101843.GA13041@isilmar.linta.de>
2005-09-19 22:35 ` [PATCH] transition latency of speedstep-ich (third try) Eric Piel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox