From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: rjw@sisk.pl, rafael.j.wysocki@intel.com,
linaro-dev@lists.linaro.org, nicolas.pitre@linaro.org,
amit.kucheria@linaro.org, mathieu.poirier@linaro.org,
linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org,
pdsw-power-team@arm.com, linux-pm@vger.kernel.org
Subject: Re: [PATCH 3/3] cpufreq: Don't use cpu removed during cpufreq_driver_unregister
Date: Fri, 04 Jan 2013 11:33:09 +0530 [thread overview]
Message-ID: <50E6709D.5080709@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAKohpo=Z=nA2Mr23ior8c0Qmt75+bOVLvZwNdc7OXq-+rH1dWQ@mail.gmail.com>
On 01/04/2013 10:49 AM, Viresh Kumar wrote:
> On 3 January 2013 19:55, Srivatsa S. Bhat
> <srivatsa.bhat@linux.vnet.ibm.com> wrote:
>> I took a quick look at the problem you described above, and the cpufreq code..
>> If we cannot avoid calling cpufreq_add_dev() from cpufreq_remove_dev(), then I can't
>> think of anything better than what your patch does.
>
> Good :)
>
>> BTW, off-topic, while going through that path, I think I found a memory leak
>> in __cpufreq_remove_dev():
>>
>> if (unlikely(cpumask_weight(data->cpus) > 1)) {
>> for_each_cpu(j, data->cpus) {
>> if (j == cpu)
>> continue;
>> per_cpu(cpufreq_cpu_data, j) = NULL;
>> }
>> }
>>
>> We are assigning NULL without freeing that memory.
>
> Not really. All cpus in affected_cpus (data->cpus), share the same
> policy structure.
> We have already taken backup of cpufreq_cpu_data for the first cpu in "data" and
> are freeing it here:
>
> kfree(data);
>
Ah, ok, got it. Thanks!
Regards,
Srivatsa S. Bhat
next prev parent reply other threads:[~2013-01-04 6:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-16 5:50 [PATCH 1/3] cpufreq: Manage only online cpus Viresh Kumar
2012-12-16 5:50 ` [PATCH 2/3] cpufreq: Notify governors when cpus are hot-[un]plugged Viresh Kumar
2012-12-16 5:50 ` [PATCH 3/3] cpufreq: Don't use cpu removed during cpufreq_driver_unregister Viresh Kumar
2013-01-03 14:25 ` Srivatsa S. Bhat
2013-01-04 5:19 ` Viresh Kumar
2013-01-04 6:03 ` Srivatsa S. Bhat [this message]
2012-12-16 13:04 ` [PATCH 1/3] cpufreq: Manage only online cpus Rafael J. Wysocki
2012-12-16 13:37 ` Viresh Kumar
2013-01-02 6:29 ` Viresh Kumar
2013-01-03 1:13 ` Rafael J. Wysocki
2013-01-03 3:32 ` Viresh Kumar
2013-01-03 12:02 ` Rafael J. Wysocki
2013-01-04 5:14 ` Viresh Kumar
2013-01-04 11:32 ` Rafael J. Wysocki
2013-01-11 22:43 ` 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=50E6709D.5080709@linux.vnet.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=amit.kucheria@linaro.org \
--cc=cpufreq@vger.kernel.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=nicolas.pitre@linaro.org \
--cc=pdsw-power-team@arm.com \
--cc=rafael.j.wysocki@intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.