[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKohpok_7pQHD3T+r2us0xOmKRQpm-0azEVbh4osFjWiO0nS9w@mail.gmail.com>
Date: Fri, 24 May 2013 11:01:35 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Xiaoguang Chen <chenxg@...vell.com>
Cc: "rjw@...k.pl" <rjw@...k.pl>,
"cpufreq@...r.kernel.org" <cpufreq@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ning Jiang <njiang1@...vell.com>, Yilu Mao <ylmao@...vell.com>,
Zhoujie Wu <zjwu@...vell.com>
Subject: Re: [PATCH] cpufreq: fix governor start/stop race condition
On 23 May 2013 08:14, Xiaoguang Chen <chenxg@...vell.com> wrote:
> Do you mean my patch will cause deadlock? I once tried to add another lock
> to protect the GOV_STOP/START sequence instead of using the rwsem in this
> patch.
> But I saw deadlock indeed.
> In cpufreq_add_policy_cpu, the lock has to be added before the rwsem since
> GOV_STOP is
> before lock_policy_rwsem_write, but in cpufreq_update_policy, it will first
> get the rwsem, and then
> call __cpufreq_set_policy which will contain GOV_STOP again, if we add the
> new lock before this GOV_STOP,
> then we may get deadlock in below sequence:
> 1) hotplug in one cpu by calling cpufreq_add_policy_cpu in which new lock is
> locked first then rwsem is locked.
> 2) governor change in cpufreq_update_policy in which rwsem is locked first
> then new lock is locked.
> this is a deadlock issue if above two steps interleaves
Check this patch.
https://patchwork-mail.kernel.org/patch/2575231/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists