2008-08-21 18:20:55

by Martin Filip

[permalink] [raw]
Subject: cpufreq regression, unable to set lower frequency

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?

--
Martin Filip <[email protected]>
jabber: [email protected]


Attachments:
signature.asc (197.00 B)
Toto je digitálně podepsan? část zpr?vy

2008-08-21 23:38:58

by Mattia Dongili

[permalink] [raw]
Subject: Re: cpufreq regression, unable to set lower frequency

On Thu, Aug 21, 2008 at 07:51:41PM +0200, Martin Filip wrote:
> 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 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
--
mattia
:wq!


Attachments:
(No filename) (1.05 kB)
signature.asc (197.00 B)
Digital signature
Download all attachments

2008-08-22 08:12:58

by Andrew Morton

[permalink] [raw]
Subject: Re: cpufreq regression, unable to set lower frequency

On Fri, 22 Aug 2008 07:55:37 +0900 Mattia Dongili <[email protected]> wrote:

> On Thu, Aug 21, 2008 at 07:51:41PM +0200, Martin Filip wrote:
> > 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 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.