2006-11-17 19:16:40

by Dhaval Giani

[permalink] [raw]
Subject: cpufreq userspace governor does not reflect changes

Hey there,

I finally managed to get cpufreq working. And while using the
userspace governor, I came up with a curious output.

[root@localhost cpufreq]# cat *
0
1862000
1596000
1862000 1596000
ondemand userspace performance
1862000
acpi-cpufreq
userspace
1862000
1596000
1862000
cat: stats: Is a directory
[root@localhost cpufreq]# echo 1596000 > scaling_setspeed
[root@localhost cpufreq]# cat *
0
1862000
1596000
1862000 1596000
ondemand userspace performance
0
acpi-cpufreq
userspace
1862000
1596000
0
cat: stats: Is a directory
[root@localhost cpufreq]#

This is on a Core 2 Duo E6300 processor. The dmesg looks like this,

cpufreq-core: setting new policy for CPU 0: 1596000 - 1862000 kHz
acpi-cpufreq: acpi_cpufreq_verify
freq-table: request for verification of policy (1596000 - 1862000 kHz) for cpu 0
freq-table: verification lead to (1596000 - 1862000 kHz) for cpu 0
acpi-cpufreq: acpi_cpufreq_verify
freq-table: request for verification of policy (1596000 - 1862000 kHz) for cpu 0
freq-table: verification lead to (1596000 - 1862000 kHz) for cpu 0
cpufreq-core: new min and max freqs are 1596000 - 1862000 kHz
cpufreq-core: governor switch
cpufreq-core: __cpufreq_governor for CPU 0, event 2
cpufreq-core: __cpufreq_governor for CPU 0, event 1
userspace: managing cpu 0 started (1596000 - 1862000 kHz, currently 1862000 kHz)
cpufreq-core: governor: change or update limits
cpufreq-core: __cpufreq_governor for CPU 0, event 3
userspace: limit event for cpu 0: 1596000 - 1862000 kHz,currently
1862000 kHz, last set to 1862000 kHz
cpufreq-core: target for CPU 0: 1862000 kHz, relation 0
acpi-cpufreq: acpi_cpufreq_target 1862000 (0)
freq-table: request for target 1862000 kHz (relation: 0) for cpu 0
freq-table: target is 0 (1862000 kHz, 0)
acpi-cpufreq: Already at target state (P0)
printk: 30 messages suppressed.
userspace: cpufreq_set for cpu 0, freq 1596000 kHz
cpufreq-core: target for CPU 0: 1596000 kHz, relation 0
acpi-cpufreq: acpi_cpufreq_target 1596000 (0)
freq-table: request for target 1596000 kHz (relation: 0) for cpu 0
freq-table: target is 1 (1596000 kHz, 9)
cpufreq-core: notification 0 of frequency transition to 0 kHz
userspace: saving cpu_cur_freq of cpu 0 to be 0 kHz
cpufreq-core: notification 1 of frequency transition to 0 kHz
userspace: saving cpu_cur_freq of cpu 0 to be 0 kHz
[root@localhost cpufreq]#

How can I verify what is the processor speed I'm running at? And is
this the result expected? (Also is this how I change the frequency in
a multi-core system? Googling did not really get me anything) As a
side note, I'm also curious to know whether multi core systems support
the processors running at multiple clock speeds? (Somewhere I remember
understanding the code to add all the processors to be added to
affected_cpus map, and if any cpu in that one is affected, all of them
are. Did i understand it right?)

Thanks and regards
Dhaval Giani


2006-11-17 19:44:01

by Pallipadi, Venkatesh

[permalink] [raw]
Subject: RE: cpufreq userspace governor does not reflect changes


/sys/devices/....../cpuX/cpufreq/scaling_cur_freq
Gives you the information about last frequency that Linux tried to set
on this CPU

/sys/devices/....../cpuX/cpufreq/cpuinfo_cur_freq
(When supported) Gives you the information about actual frequency that
the CPU is running at.

Zero frequency value below is certainly a bug in the driver. What is the
kernel you are using?
On the particular CPU you have here, all cores in a package indeed share
the frequency. But, it does not really show up in affected_cpus as OS is
not coordinating the shared-ness of P-state across cores. That means, OS
programs each core individually based on CPU utilization and hardware
will pick the highest frequency among the two and run both cores at that
frequency.

-Venki

>-----Original Message-----
>From: Dhaval Giani [mailto:[email protected]]
>Sent: Friday, November 17, 2006 11:17 AM
>To: Pallipadi, Venkatesh; [email protected]
>Cc: [email protected]
>Subject: cpufreq userspace governor does not reflect changes
>
>Hey there,
>
>I finally managed to get cpufreq working. And while using the
>userspace governor, I came up with a curious output.
>
>[root@localhost cpufreq]# cat *
>0
>1862000
>1596000
>1862000 1596000
>ondemand userspace performance
>1862000
>acpi-cpufreq
>userspace
>1862000
>1596000
>1862000
>cat: stats: Is a directory
>[root@localhost cpufreq]# echo 1596000 > scaling_setspeed
>[root@localhost cpufreq]# cat *
>0
>1862000
>1596000
>1862000 1596000
>ondemand userspace performance
>0
>acpi-cpufreq
>userspace
>1862000
>1596000
>0
>cat: stats: Is a directory
>[root@localhost cpufreq]#
>
>This is on a Core 2 Duo E6300 processor. The dmesg looks like this,
>
>cpufreq-core: setting new policy for CPU 0: 1596000 - 1862000 kHz
>acpi-cpufreq: acpi_cpufreq_verify
>freq-table: request for verification of policy (1596000 -
>1862000 kHz) for cpu 0
>freq-table: verification lead to (1596000 - 1862000 kHz) for cpu 0
>acpi-cpufreq: acpi_cpufreq_verify
>freq-table: request for verification of policy (1596000 -
>1862000 kHz) for cpu 0
>freq-table: verification lead to (1596000 - 1862000 kHz) for cpu 0
>cpufreq-core: new min and max freqs are 1596000 - 1862000 kHz
>cpufreq-core: governor switch
>cpufreq-core: __cpufreq_governor for CPU 0, event 2
>cpufreq-core: __cpufreq_governor for CPU 0, event 1
>userspace: managing cpu 0 started (1596000 - 1862000 kHz,
>currently 1862000 kHz)
>cpufreq-core: governor: change or update limits
>cpufreq-core: __cpufreq_governor for CPU 0, event 3
>userspace: limit event for cpu 0: 1596000 - 1862000 kHz,currently
>1862000 kHz, last set to 1862000 kHz
>cpufreq-core: target for CPU 0: 1862000 kHz, relation 0
>acpi-cpufreq: acpi_cpufreq_target 1862000 (0)
>freq-table: request for target 1862000 kHz (relation: 0) for cpu 0
>freq-table: target is 0 (1862000 kHz, 0)
>acpi-cpufreq: Already at target state (P0)
>printk: 30 messages suppressed.
>userspace: cpufreq_set for cpu 0, freq 1596000 kHz
>cpufreq-core: target for CPU 0: 1596000 kHz, relation 0
>acpi-cpufreq: acpi_cpufreq_target 1596000 (0)
>freq-table: request for target 1596000 kHz (relation: 0) for cpu 0
>freq-table: target is 1 (1596000 kHz, 9)
>cpufreq-core: notification 0 of frequency transition to 0 kHz
>userspace: saving cpu_cur_freq of cpu 0 to be 0 kHz
>cpufreq-core: notification 1 of frequency transition to 0 kHz
>userspace: saving cpu_cur_freq of cpu 0 to be 0 kHz
>[root@localhost cpufreq]#
>
>How can I verify what is the processor speed I'm running at? And is
>this the result expected? (Also is this how I change the frequency in
>a multi-core system? Googling did not really get me anything) As a
>side note, I'm also curious to know whether multi core systems support
>the processors running at multiple clock speeds? (Somewhere I remember
>understanding the code to add all the processors to be added to
>affected_cpus map, and if any cpu in that one is affected, all of them
>are. Did i understand it right?)
>
>Thanks and regards
>Dhaval Giani
>

2006-11-17 19:48:21

by Dhaval Giani

[permalink] [raw]
Subject: Re: cpufreq userspace governor does not reflect changes

Hey,

On 11/18/06, Pallipadi, Venkatesh <[email protected]> wrote:
>
> /sys/devices/....../cpuX/cpufreq/scaling_cur_freq
> Gives you the information about last frequency that Linux tried to set
> on this CPU
>
> /sys/devices/....../cpuX/cpufreq/cpuinfo_cur_freq
> (When supported) Gives you the information about actual frequency that
> the CPU is running at.
>
> Zero frequency value below is certainly a bug in the driver. What is the
> kernel you are using?

Ooops! sorry missed that one. Its the 2.6.19-rc5-mm2. Its having the
same .config which i posted on the bugzilla. Do you want the acpidump
again?

> On the particular CPU you have here, all cores in a package indeed share
> the frequency. But, it does not really show up in affected_cpus as OS is
> not coordinating the shared-ness of P-state across cores. That means, OS
> programs each core individually based on CPU utilization and hardware
> will pick the highest frequency among the two and run both cores at that
> frequency.
>

Hold on, so let me get it right. When i do an echo 1596000 >
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed, the cpu cores
will still be running at 1.86 Ghz since the other core is at that
frequency? In this situation how do I then change the frequency?

Thanks
Dhaval

2006-11-17 19:58:14

by Pallipadi, Venkatesh

[permalink] [raw]
Subject: RE: cpufreq userspace governor does not reflect changes



>-----Original Message-----
>From: Dhaval Giani [mailto:[email protected]]
>Sent: Friday, November 17, 2006 11:48 AM
>To: Pallipadi, Venkatesh
>Cc: [email protected]; [email protected]
>Subject: Re: cpufreq userspace governor does not reflect changes
>
>Hey,
>
>On 11/18/06, Pallipadi, Venkatesh
><[email protected]> wrote:
>>
>> /sys/devices/....../cpuX/cpufreq/scaling_cur_freq
>> Gives you the information about last frequency that Linux
>tried to set
>> on this CPU
>>
>> /sys/devices/....../cpuX/cpufreq/cpuinfo_cur_freq
>> (When supported) Gives you the information about actual
>frequency that
>> the CPU is running at.
>>
>> Zero frequency value below is certainly a bug in the driver.
>What is the
>> kernel you are using?
>
>Ooops! sorry missed that one. Its the 2.6.19-rc5-mm2. Its having the
>same .config which i posted on the bugzilla. Do you want the acpidump
>again?

Not really. There were couple of fixes that went in recently. I can send
pointers to those to you.

>
>> On the particular CPU you have here, all cores in a package
>indeed share
>> the frequency. But, it does not really show up in
>affected_cpus as OS is
>> not coordinating the shared-ness of P-state across cores.
>That means, OS
>> programs each core individually based on CPU utilization and hardware
>> will pick the highest frequency among the two and run both
>cores at that
>> frequency.
>>
>
>Hold on, so let me get it right. When i do an echo 1596000 >
>/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed, the cpu cores
>will still be running at 1.86 Ghz since the other core is at that
>frequency? In this situation how do I then change the frequency?
>

Yes. You just have to change the frequency on both the cores.

-Venki

2006-11-17 20:03:14

by Dhaval Giani

[permalink] [raw]
Subject: Re: cpufreq userspace governor does not reflect changes

On 11/18/06, Pallipadi, Venkatesh <[email protected]> wrote:
>
>
> >-----Original Message-----
> >From: Dhaval Giani [mailto:[email protected]]
> >Sent: Friday, November 17, 2006 11:48 AM
> >To: Pallipadi, Venkatesh
> >Cc: [email protected]; [email protected]
> >Subject: Re: cpufreq userspace governor does not reflect changes
> >
> >Hey,
> >
> >On 11/18/06, Pallipadi, Venkatesh
> ><[email protected]> wrote:
> >>
> >> /sys/devices/....../cpuX/cpufreq/scaling_cur_freq
> >> Gives you the information about last frequency that Linux
> >tried to set
> >> on this CPU
> >>
> >> /sys/devices/....../cpuX/cpufreq/cpuinfo_cur_freq
> >> (When supported) Gives you the information about actual
> >frequency that
> >> the CPU is running at.
> >>
> >> Zero frequency value below is certainly a bug in the driver.
> >What is the
> >> kernel you are using?
> >
> >Ooops! sorry missed that one. Its the 2.6.19-rc5-mm2. Its having the
> >same .config which i posted on the bugzilla. Do you want the acpidump
> >again?
>
> Not really. There were couple of fixes that went in recently. I can send
> pointers to those to you.
>

Ok, I will try them. Can you please point me?

Dhaval

2006-11-17 20:52:51

by Dhaval Giani

[permalink] [raw]
Subject: Re: cpufreq userspace governor does not reflect changes

Hey,

On 11/18/06, Dhaval Giani <[email protected]> wrote:
> On 11/18/06, Pallipadi, Venkatesh <[email protected]> wrote:
> >
> >
> > >-----Original Message-----
> > >From: Dhaval Giani [mailto:[email protected]]
> > >Sent: Friday, November 17, 2006 11:48 AM
> > >To: Pallipadi, Venkatesh
> > >Cc: [email protected]; [email protected]
> > >Subject: Re: cpufreq userspace governor does not reflect changes
> > >
> > >Hey,
> > >
> > >On 11/18/06, Pallipadi, Venkatesh
> > ><[email protected]> wrote:
> > >>
> > >> /sys/devices/....../cpuX/cpufreq/scaling_cur_freq
> > >> Gives you the information about last frequency that Linux
> > >tried to set
> > >> on this CPU
> > >>
> > >> /sys/devices/....../cpuX/cpufreq/cpuinfo_cur_freq
> > >> (When supported) Gives you the information about actual
> > >frequency that
> > >> the CPU is running at.
> > >>
> > >> Zero frequency value below is certainly a bug in the driver.
> > >What is the
> > >> kernel you are using?
> > >
> > >Ooops! sorry missed that one. Its the 2.6.19-rc5-mm2. Its having the
> > >same .config which i posted on the bugzilla. Do you want the acpidump
> > >again?
> >
> > Not really. There were couple of fixes that went in recently. I can send
> > pointers to those to you.
> >
>
> Ok, I will try them. Can you please point me?
>

I tried the patch at http://lkml.org/lkml/2006/11/15/302 and that
fixes the problem.

Thanks
Dhaval