Bug 55261 - down_threshold is missing
Summary: down_threshold is missing
Status: CLOSED INVALID
Alias: None
Product: Power Management
Classification: Unclassified
Component: cpufreq (show other bugs)
Hardware: All Linux
: P1 enhancement
Assignee: Lan Tianyu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-15 06:14 UTC by sworddragon2
Modified: 2013-11-22 14:24 UTC (History)
3 users (show)

See Also:
Kernel Version: Ubuntu 3.8.0-12.21-generic 3.8.2
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description sworddragon2 2013-03-15 06:14:57 UTC
On my system the file /sys/devices/system/cpu/cpufreq/ondemand/down_threshold doesn't exist while the file up_threshold does exist in the same directory. The problem is without this file the value of down_threshold seems to be automatically set to 10 so I'm not able to set up_threshold to a value lower than 11.
Comment 1 Viresh Kumar 2013-03-15 08:58:02 UTC
This happened a long time back for ondemand governor (it is still supported by conservative though).

commit c29f1403098135bdef75b190a5037db514701031
Author: Dave Jones <davej@redhat.com>
Date:   Tue May 31 19:03:50 2005 -0700

    [CPUFREQ] ondemand governor automatic downscaling
    
    [PATCH] [4/5] ondemand governor automatic downscaling
    
    Here is a change of policy for the ondemand governor. The modification
    concerns the frequency downscaling. Instead of decreasing to a lower
    frequency when the CPU usage is under 20%, this new policy automatically
    scales to the optimal frequency. The optimal frequency being the lowest
    frequency which provides enough power to not trigger the upscaling policy.
    
    Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
    Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
    Signed-off-by: Dave Jones <davej@redhat.com>

---
 drivers/cpufreq/cpufreq_ondemand.c | 117 +++++++++++++++++++++++------------------------------------------------------------------------------------
 1 file changed, 25 insertions(+), 92 deletions(-)
Comment 2 sworddragon2 2013-03-15 12:02:09 UTC
This makes it dificult to get an early upscaling of the cpu frequency. I'm trying to achieve this at ~1% cpu usage. Would it be possible after this commit to allow up_threshold to be lower (for example 1 on my system)?
Comment 3 Lan Tianyu 2013-04-18 06:59:14 UTC
Hi, sworddragon2:
          This is not a bug but "a change of policy for the ondemand governor". So close this as invalid.

Hi Viresh:
         Could you answer sworddragon2's question in the comment2?
Comment 4 Viresh Kumar 2013-04-18 07:45:32 UTC
(In reply to comment #2)
> This makes it dificult to get an early upscaling of the cpu frequency. I'm
> trying to achieve this at ~1% cpu usage. Would it be possible after this
> commit
> to allow up_threshold to be lower (for example 1 on my system)?

I didn't get exactly what behavior you want. Can you elaborate it a bit?
Comment 5 sworddragon2 2013-04-18 08:15:51 UTC
> I didn't get exactly what behavior you want. Can you elaborate it a bit?

My goal: As soon as an application reaches 1% of cpu usage the related cpu should scale its frequency to the maximum. if the application goes into idle (below 1% of cpu usage) it should scale the frequency to the minimum.

With this behavior I would achieve a high energy saving without loosing any performance (see this report for more details: https://bugzilla.kernel.org/show_bug.cgi?id=54761).

To achieve this behavior 2 steps are needed:

1. up_threshold needs a low value. Currently it is limited to 11 because down_threshold is internally set to 10. Ideally down_threshold would set itself to up_threshold - 1 if up_threshold < 11 and up_threshold > 1.

2. Currently up_threshold must be higher than down_threshold which would it make impossible to set up_threshold to 1. It should be possible to set both values to the same value. up_threshold triggers only if the cpu usage >= than up_threshold and down_threshold triggers only if the cpu usage < down_threshold. This way both values can have the same value without making any troubles (which would also allow a higher precision of the scaling).


In practice: I would have an energy saving system because all the processes are commonly in idle (below 1% of cpu usage). So my cpu would stay at 800 MHz. But as soon as I'm staring an application (like a game) my cpu would scale to 2700 MHz.

Is my suggestion technically possible or have I missed something?
Comment 6 Lan Tianyu 2013-11-22 08:42:38 UTC
Hi, sworddragon2:
          I think this is a special user case rather than a bug. You can put your opinion to cpufreq maillist and you will get more responses there.
Comment 7 sworddragon2 2013-11-22 14:23:49 UTC
Mainly it is an enhancement (while finding a related bug). But at least I can split out the bug to another report.

But I don't get it: Why don't we let the user decide which values he wants for up_threshold and down_threshold? Why must me treat users like a child here? What would be the problem if the user can fully configure this? Please explain it to me why we are forbidding the user to use down_threshold < 10.

Note You need to log in before you can comment on or make changes to this bug.