From: Francesco Lavra <francescolavra.fl@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: rjw@sisk.pl, Steve.Bannister@arm.com,
linaro-dev@lists.linaro.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org
Subject: Re: [PATCH 4/4] cpufreq: governor: Implement per policy instances of governors
Date: Sun, 10 Feb 2013 22:14:15 +0100 [thread overview]
Message-ID: <51180DA7.8040203@gmail.com> (raw)
In-Reply-To: <b16436f3b3eba648500a287d552efbbf48bcc9bb.1359976493.git.viresh.kumar@linaro.org>
Hi,
On 02/04/2013 12:38 PM, Viresh Kumar wrote:
> Currently, there can't be multiple instances of single governor_type. If we have
> a multi-package system, where we have multiple instances of struct policy (per
> package), we can't have multiple instances of same governor. i.e. We can't have
> multiple instances of ondemand governor for multiple packages.
>
> Governors directory in sysfs is created at /sys/devices/system/cpu/cpufreq/
> governor-name/. Which again reflects that there can be only one instance of a
> governor_type in the system.
>
> This is a bottleneck for multicluster system, where we want different packages
> to use same governor type, but with different tunables.
>
> This patch uses the infrastructure provided by earlier patch and implements
> init/exit routines for ondemand and conservative governors.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/cpufreq/cpufreq.c | 4 -
> drivers/cpufreq/cpufreq_conservative.c | 142 +++++++++++++----------
> drivers/cpufreq/cpufreq_governor.c | 138 +++++++++++++---------
> drivers/cpufreq/cpufreq_governor.h | 42 ++++---
> drivers/cpufreq/cpufreq_ondemand.c | 205 +++++++++++++++++++--------------
> include/linux/cpufreq.h | 19 +--
> 6 files changed, 314 insertions(+), 236 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 1ae78d4..7aacfbf 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1551,9 +1551,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
> policy->cpu, event);
> ret = policy->governor->governor(policy, event);
>
> - if (!policy->governor->initialized && (event == CPUFREQ_GOV_START))
> - policy->governor->initialized = 1;
> -
> /* we keep one module reference alive for
> each CPU governed by this CPU */
> if ((event != CPUFREQ_GOV_START) || ret)
> @@ -1577,7 +1574,6 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
>
> mutex_lock(&cpufreq_governor_mutex);
>
> - governor->initialized = 0;
> err = -EBUSY;
> if (__find_governor(governor->name) == NULL) {
> err = 0;
> diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
[...]
> +static int cs_init(struct dbs_data *dbs_data)
> +{
> + struct cs_dbs_tuners *tuners;
> +
> + tuners = kzalloc(sizeof(struct cs_dbs_tuners), GFP_KERNEL);
> + if (!tuners) {
> + pr_err("%s: kzalloc failed\n", __func__);
> + return -ENOMEM;
> + }
> +
> + tuners->up_threshold = DEF_FREQUENCY_UP_THRESHOLD;
> + tuners->down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD;
> + tuners->sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR;
> + tuners->ignore_nice = 0;
> + tuners->freq_step = 5;
> +
> + dbs_data->tuners = tuners;
dbs_data->tuners is never freed, which means there is a memory leak
across CPUFREQ_GOV_POLICY_INIT and CPUFREQ_GOV_POLICY_EXIT events.
The same goes for the ondemand governor.
Regards,
Francesco
next prev parent reply other threads:[~2013-02-10 21:14 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-04 11:38 [PATCH 0/4] CPUFreq: Implement per policy instances of governors Viresh Kumar
[not found] ` <cover.1359976493.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-02-04 11:38 ` [PATCH 1/4] cpufreq: Don't check cpu_online(policy->cpu) Viresh Kumar
2013-02-04 11:38 ` [PATCH 2/4] cpufreq: stats: Get rid of CPUFREQ_STATDEVICE_ATTR Viresh Kumar
2013-02-04 11:38 ` [PATCH 3/4] cpufreq: Add per policy governor-init/exit infrastructure Viresh Kumar
2013-02-04 11:38 ` [PATCH 4/4] cpufreq: governor: Implement per policy instances of governors Viresh Kumar
2013-02-10 21:14 ` Francesco Lavra [this message]
2013-02-11 4:16 ` Viresh Kumar
2013-02-11 4:39 ` Viresh Kumar
2013-02-04 12:17 ` [PATCH 0/4] CPUFreq: " Rafael J. Wysocki
2013-02-04 12:24 ` Viresh Kumar
2013-02-04 12:32 ` Borislav Petkov
2013-02-04 12:54 ` Viresh Kumar
2013-02-04 13:04 ` Borislav Petkov
2013-02-04 13:25 ` Viresh Kumar
2013-02-04 13:36 ` Borislav Petkov
2013-02-04 13:58 ` Viresh Kumar
2013-02-04 14:09 ` Borislav Petkov
2013-02-04 14:21 ` Viresh Kumar
2013-02-04 15:05 ` Borislav Petkov
2013-02-04 15:37 ` Viresh Kumar
2013-02-04 16:50 ` Borislav Petkov
2013-02-05 7:20 ` Viresh Kumar
2013-02-05 9:15 ` Borislav Petkov
[not found] ` <20130205091532.GA4827-fF5Pk5pvG8Y@public.gmane.org>
2013-02-05 9:47 ` Viresh Kumar
2013-02-05 10:27 ` Borislav Petkov
2013-02-05 10:43 ` Viresh Kumar
2013-02-05 11:04 ` Borislav Petkov
2013-02-05 11:12 ` Viresh Kumar
2013-02-05 11:19 ` Borislav Petkov
2013-02-05 11:26 ` Viresh Kumar
2013-02-05 11:32 ` Borislav Petkov
2013-02-05 12:24 ` Viresh Kumar
2013-02-05 13:22 ` Borislav Petkov
2013-02-05 13:55 ` Viresh Kumar
2013-02-05 9:36 ` Viresh Kumar
[not found] ` <CAKohpokejWugM+wP5xcqp0F9AggLxuEf9Ox5fDViMxJh1c+kEw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-05 11:29 ` Charles Garcia-Tobin
2013-02-05 11:39 ` Borislav Petkov
2013-02-05 18:38 ` Charles Garcia-Tobin
2013-02-05 18:44 ` Borislav Petkov
2013-02-05 16:21 ` Viresh Kumar
2013-02-06 9:58 ` Viresh Kumar
2013-02-06 10:08 ` Amit Kucheria
2013-02-06 10:15 ` Viresh Kumar
2013-02-06 10:38 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51180DA7.8040203@gmail.com \
--to=francescolavra.fl@gmail.com \
--cc=Steve.Bannister@arm.com \
--cc=cpufreq@vger.kernel.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).