From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Yadwinder Singh Brar <yadi.brar@samsung.com>
Cc: 'Viresh Kumar' <viresh.kumar@linaro.org>,
"'Rafael J. Wysocki'" <rjw@rjwysocki.net>,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
'Eduardo Valentin' <edubezval@gmail.com>
Subject: Re: 3.18: lockdep problems in cpufreq
Date: Mon, 15 Dec 2014 17:43:36 +0000 [thread overview]
Message-ID: <20141215174336.GJ11285@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <003501d01876$fbc53f80$f34fbe80$%brar@samsung.com>
On Mon, Dec 15, 2014 at 08:24:05PM +0530, Yadwinder Singh Brar wrote:
> > The answer may well be to have finer grained locking here:
> >
> > - one lock to protect cpufreq_dev_list, which is only ever taken when
> > adding or removing entries from it
> >
> > - a second lock to protect cpufreq_dev_count and the calls to
> > cpufreq_register_notifier() and cpufreq_unregister_notifier()
> >
> > and you would /never/ take either of those two locks inside each other.
> > In other words:
> >
> > mutex_lock(&cooling_list_lock);
> > list_add(&cpufreq_dev->node, &cpufreq_dev_list);
> > mutex_unlock(&cooling_list_lock);
> >
> > mutex_lock(&cooling_cpufreq_lock);
> > if (cpufreq_dev_count++ == 0)
> > cpufreq_register_notifier(&thermal_cpufreq_notifier_block,
> > CPUFREQ_POLICY_NOTIFIER);
> > mutex_unlock(&cooling_cpufreq_lock);
> >
> > and similar in the cleanup path. The notifier itself would only ever
> > take the cooling_list_lock.
> >
>
> I agree with this approach, if its fine for others also, I can implement
> and post patch.
Yes, please do.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2014-12-15 17:43 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-14 21:36 3.18: lockdep problems in cpufreq Russell King - ARM Linux
2014-12-14 22:23 ` Rafael J. Wysocki
2014-12-15 3:56 ` Viresh Kumar
2014-12-15 13:28 ` Yadwinder Singh Brar
2014-12-15 13:46 ` Russell King - ARM Linux
2014-12-15 14:54 ` Yadwinder Singh Brar
2014-12-15 17:43 ` Russell King - ARM Linux [this message]
2014-12-15 21:41 ` Rafael J. Wysocki
2014-12-15 23:09 ` Russell King - ARM Linux
2014-12-16 3:41 ` Viresh Kumar
2015-01-06 15:38 ` Russell King - ARM Linux
2015-05-18 18:56 ` Russell King - ARM Linux
2015-05-18 22:05 ` Rafael J. Wysocki
2015-08-11 17:03 ` Russell King - ARM Linux
2015-08-12 5:16 ` Viresh Kumar
2015-08-12 7:21 ` Russell King - ARM Linux
2015-08-12 7:35 ` Viresh Kumar
2015-08-12 7:49 ` Russell King - ARM Linux
2015-08-12 8:12 ` Viresh Kumar
2015-08-12 9:08 ` Russell King - ARM Linux
2015-08-12 9:19 ` Viresh Kumar
2015-08-13 1:20 ` Rafael J. Wysocki
2015-08-13 8:17 ` Russell King - ARM Linux
2015-08-13 8:22 ` Viresh Kumar
2015-08-18 1:32 ` Rafael J. Wysocki
2015-08-18 9:30 ` Eduardo Valentin
2014-12-16 3:37 ` Viresh Kumar
2014-12-15 14:38 ` Viresh Kumar
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=20141215174336.GJ11285@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=edubezval@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.org \
--cc=yadi.brar@samsung.com \
/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).