Skip to contentSkip to conversation

cpufreq regression, unable to set lower frequency

DISCUSSION Martin Filip 3 participants 3 messages Aug 21, 2008 – Aug 22, 2008

lore
Share & tools
lore
#0 lore raw

Hi LKML,

I've upgraded my kernel few days earlier and suddenly my cpufreqd stopperd working. My configuration is this:
AC adapter connected:
set scaling_max_freq and scaling_min_freq to maximal available
frequency
AC adapter disconnected:
set scaling_max_freq to maximal available, scaling_min_freq to minimal
available.

When I connect AC adapter, everything works fine but when I disconnect my adapter, everything remains on maximal frequency and in logs I can see:

cpufreqd: cpufreqd_set_profile: Couldn't set profile "Powersave Low" set for cpu0

After some tests I've traced problem to

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.25.y.git;a=commitdiff;h=53391fa20cab6df6b476a5a0ad6be653c9de0c46

What do you think? Is this condition correct?

# cd /sys/devices/system/cpu/cpu0/cpufreq/

when AC adapter is connected, something like this should happen:

# cat scaling_available_frequencies 
2167000 2000000 1833000 1667000 1500000 1333000 1000000 
# echo 2167000 > scaling_max_freq 
# echo 2167000 > scaling_min_freq 

when disconnected, something like this should:

# echo 1000000 > scaling_max_freq 
-su: echo: write error: Invalid argument
# echo 1000000 > scaling_min_freq

after min is set, max can be lowered to. Before this patch, lowering max below min lead to lowering of min to the same value.

I think that this whole condition must not be here at all. After removing this condition the kernel behaves like this:

# cat scaling_min_freq scaling_max_freq 
2167000
2167000
# echo 1000000 > scaling_max_freq
# cat scaling_min_freq scaling_max_freq
1000000
1000000
# echo 2167000 > scaling_min_freq
# cat scaling_min_freq scaling_max_freq
1000000
1000000
# echo 2167000 > scaling_max_freq
# echo 2167000 > scaling_min_freq
# cat scaling_min_freq scaling_max_freq
2167000
2167000

Which I think is not perfect but is better then current behavior. What do you think?

Signature · 2 lines
Martin Filip <[email protected]>
jabber: [email protected]
#1 lore raw
Quoted 15 lines · Martin Filip

Hi LKML,

I've upgraded my kernel few days earlier and suddenly my cpufreqd stopperd working. My configuration is this:
AC adapter connected:
set scaling_max_freq and scaling_min_freq to maximal available
frequency
AC adapter disconnected:
set scaling_max_freq to maximal available, scaling_min_freq to minimal
available.

When I connect AC adapter, everything works fine but when I disconnect my adapter, everything remains on maximal frequency and in logs I can see:

Quoted 6 lines

cpufreqd: cpufreqd_set_profile: Couldn't set profile "Powersave Low" set for cpu0

After some tests I've traced problem to

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.25.y.git;a=commitdiff;h=53391fa20cab6df6b476a5a0ad6be653c9de0c46

what version of cpufrequtils are running? This error should be fixed in 004 (or later) with this patch:
http://git.kernel.org/?p=utils/kernel/cpufreq/cpufrequtils.git;a=commit;h=b88f8975d27690e04e520b05a1ed66bf1e306ee6

thanks

Signature · 2 lines
mattia
:wq!
#2 lore raw
Quoted 19 lines · On Fri, 22 Aug 2008 07:55:37 +0900 Mattia Dongili <[email protected]> wrote:
Quoted 18 lines · Martin Filip

Hi LKML,

I've upgraded my kernel few days earlier and suddenly my cpufreqd stopperd working. My configuration is this:
AC adapter connected:
set scaling_max_freq and scaling_min_freq to maximal available
frequency
AC adapter disconnected:
set scaling_max_freq to maximal available, scaling_min_freq to minimal
available.

When I connect AC adapter, everything works fine but when I disconnect my adapter, everything remains on maximal frequency and in logs I can see:

cpufreqd: cpufreqd_set_profile: Couldn't set profile "Powersave Low" set for cpu0

Quoted 8 lines
Quoted 3 lines

After some tests I've traced problem to

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.25.y.git;a=commitdiff;h=53391fa20cab6df6b476a5a0ad6be653c9de0c46

what version of cpufrequtils are running? This error should be fixed in 004 (or later) with this patch:
http://git.kernel.org/?p=utils/kernel/cpufreq/cpufrequtils.git;a=commit;h=b88f8975d27690e04e520b05a1ed66bf1e306ee6

We don't require that people upgrade their userspace to something which was written only a month ago so that 2.6.27 works correctly.

Start here: http://lkml.org/lkml/2008/7/30/45 to see why.

It would be better to find a kernel change which will cause 2.6.27 to support people's current cpufrequtils correctly. Reverting 53391fa20cab6df6b476a5a0ad6be653c9de0c4 might be one approach.

otoh, 53391fa20cab6df6b476a5a0ad6be653c9de0c46 was written six months ago and is in 2.6.25.x and (presumably) 2.6.26.x, from which I assume this regression affects very few people. So we _might_ be able to get away with it.