lkml.org 
[lkml]   [2016]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 11/19] cpufreq: assert policy->rwsem is held in __cpufreq_governor
On 02/02/2016 09:02 PM, Viresh Kumar wrote:
> On 02-02-16, 20:04, Saravana Kannan wrote:
>> What's the s_active lock in CPU1 coming from?
>
> That's taken by sysfs core while removing the files.
>
>> The only reason it's there
>> today is because of the sysfs dir remove. If you move it before the
>> policy->rwsem, you won't have it after the policy->rwsem too. So, I think it
>> will fix the issue.
>
> Its complex and we will end up making ugly..

I disagree. I think it's way better and simpler than this patch set. It
also doesn't tie into cpufreq_governor.* which is a good thing IMO since
it keeps things simpler for sched-dvfs too.

> For example, EXIT can be called while switching governors. The
> policy->rwsem is taken at the beginning cpufreq_set_policy(). To
> decide if we should remove the governor sysfs directory so early (i.e.
> before taking rwsem) in the call, is going to be difficult.

Just check if the governor is changing. And if it is, you just need to
remove the policy specific stuff.

> Over that the same directory might be shared across multiple policies,
> and all that information is present only with the governor-core.

That's why I said the gov needs to register the per pol and system wide
attrs list separately.

This will also remove the need for ever governor to do this crap.

-Saravana

--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

\
 
 \ /
  Last update: 2016-02-03 06:41    [W:0.129 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site