From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755341AbcBCCOF (ORCPT ); Tue, 2 Feb 2016 21:14:05 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:33461 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754614AbcBCCOD (ORCPT ); Tue, 2 Feb 2016 21:14:03 -0500 Date: Wed, 3 Feb 2016 07:43:59 +0530 From: Viresh Kumar To: Saravana Kannan Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Juri Lelli , Linux Kernel Mailing List , "linux-pm@vger.kernel.org" , Peter Zijlstra , Michael Turquette , Steve Muckle , Vincent Guittot , Morten Rasmussen , dietmar.eggemann@arm.com Subject: Re: [RFC PATCH 11/19] cpufreq: assert policy->rwsem is held in __cpufreq_governor Message-ID: <20160203021359.GL31828@vireshk> References: <1452533760-13787-1-git-send-email-juri.lelli@arm.com> <20160112102025.GC1084@ubuntu> <56AC04E3.8090900@codeaurora.org> <1703921.2AHaiQoggk@vostro.rjw.lan> <20160201060943.GH13476@vireshk> <56AFBEE5.70501@codeaurora.org> <20160202063449.GF31828@vireshk> <56B12191.8020407@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B12191.8020407@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02-02-16, 13:37, Saravana Kannan wrote: > On 02/01/2016 10:34 PM, Viresh Kumar wrote: > >What will that solve? It will stay exactly same then as well, as we > >would be adding/removing these attributes from within the same > >policy->rwsem .. > > The problem isn't that you are holding the policy rwsem. The problem is that > we are trying to grab the same locks in different order. This is trying to > fix that. That's exactly what I was trying to say, sorry for not being very clear. Even if you would move the sysfs file creation thing into the cpufreq core, instead of governor, we will have locks this way: CPU0 CPU1 (sysfs read) (sysfs dir remove) s_active lock policy->rwsem policy->rwsem s_active lock (hang) And so I said, nothing will change. -- viresh