lkml.org 
[lkml]   [2009]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] cpufreq: Governor poll frequency tuneables exported in config.
    Date
        cpufreq: Governor poll frequency tuneables exported in config.

    Signed-off-by: Mike Chan <mike@android.com>

    diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
    index 5f076ae..e9361a9 100644
    --- a/drivers/cpufreq/Kconfig
    +++ b/drivers/cpufreq/Kconfig
    @@ -190,4 +190,17 @@ config CPU_FREQ_GOV_CONSERVATIVE

    If in doubt, say N.

    +config CPU_FREQ_MIN_TICKS
    + int "Ticks between governor polling interval."
    + default 10
    + help
    + Minimum number of ticks between polling interval for governors.
    +
    +config CPU_FREQ_SAMPLING_LATENCY_MULTIPLIER
    + int "Sampling rate multiplier for governors."
    + default 1000
    + help
    + Sampling latency rate multiplied by the cpu switch latency.
    + Affects governor polling.
    +
    endif # CPU_FREQ
    diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
    index ac0bbf2..7bc227e 100644
    --- a/drivers/cpufreq/cpufreq_conservative.c
    +++ b/drivers/cpufreq/cpufreq_conservative.c
    @@ -51,11 +51,10 @@ static unsigned int def_sampling_rate;
    #define MIN_SAMPLING_RATE_RATIO (2)
    /* for correct statistics, we need at least 10 ticks between each measure */
    #define MIN_STAT_SAMPLING_RATE \
    - (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10))
    + (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(CONFIG_CPU_FREQ_MIN_TICKS))
    #define MIN_SAMPLING_RATE \
    (def_sampling_rate / MIN_SAMPLING_RATE_RATIO)
    #define MAX_SAMPLING_RATE (500 * def_sampling_rate)
    -#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
    #define DEF_SAMPLING_DOWN_FACTOR (1)
    #define MAX_SAMPLING_DOWN_FACTOR (10)
    #define TRANSITION_LATENCY_LIMIT (10 * 1000 * 1000)
    @@ -523,7 +522,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
    latency = 1;

    def_sampling_rate = 10 * latency *
    - DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
    + CONFIG_CPU_FREQ_SAMPLING_LATENCY_MULTIPLIER;

    if (def_sampling_rate < MIN_STAT_SAMPLING_RATE)
    def_sampling_rate = MIN_STAT_SAMPLING_RATE;
    diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
    index 33855cb..c7df643 100644
    --- a/drivers/cpufreq/cpufreq_ondemand.c
    +++ b/drivers/cpufreq/cpufreq_ondemand.c
    @@ -42,11 +42,10 @@ static unsigned int def_sampling_rate;
    #define MIN_SAMPLING_RATE_RATIO (2)
    /* for correct statistics, we need at least 10 ticks between each measure */
    #define MIN_STAT_SAMPLING_RATE \
    - (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10))
    + (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(CONFIG_CPU_FREQ_MIN_TICKS))
    #define MIN_SAMPLING_RATE \
    (def_sampling_rate / MIN_SAMPLING_RATE_RATIO)
    #define MAX_SAMPLING_RATE (500 * def_sampling_rate)
    -#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
    #define TRANSITION_LATENCY_LIMIT (10 * 1000 * 1000)

    static void do_dbs_timer(struct work_struct *work);
    @@ -542,7 +541,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
    latency = 1;

    def_sampling_rate = latency *
    - DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
    + CONFIG_CPU_FREQ_SAMPLING_LATENCY_MULTIPLIER;

    if (def_sampling_rate < MIN_STAT_SAMPLING_RATE)
    def_sampling_rate = MIN_STAT_SAMPLING_RATE;

    \
     
     \ /
      Last update: 2009-02-12 21:11    [W:2.972 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site