From mboxrd@z Thu Jan 1 00:00:00 1970 From: skannan@codeaurora.org Subject: Re: [PATCH] cpufreq, store_scaling_governor requires policy->rwsem to be held for duration of changing governors [v2] Date: Tue, 5 Aug 2014 06:29:12 -0000 Message-ID: <3848ac8b087052a65d890dcfe17e3af8.squirrel@www.codeaurora.org> References: <1406634362-811-1-git-send-email-prarit@redhat.com> <2066166.pXm4lKLOID@vostro.rjw.lan> <53DA8389.80804@redhat.com> <1917362.abr2Y4p7vh@vostro.rjw.lan> <53DA8A41.2030601@redhat.com> <53DAA60B.6040802@codeaurora.org> <53DAA749.5080506@redhat.com> <53DAA95B.2040505@codeaurora.org> <53DAB038.3050007@redhat.com> <53DABFA6.6090503@codeaurora.org> <53DACA26.1000908@redhat.com> <53DAE592.2030909@codeaurora.org> <53DB6B81.6050400@redhat.com> <53DBCBE8.6010809@codeaurora.org> <53DF7BC4.9070500@redhat.com> <53DFEA25.5070206@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Viresh Kumar Cc: Saravana Kannan , Prarit Bhargava , Stephen Boyd , "Rafael J. Wysocki" , Linux Kernel Mailing List , Lenny Szubowicz , "linux-pm@vger.kernel.org" , =?iso-8859-1?Q?=22Robert_Sch=C3=B6ne=22?= List-Id: linux-pm@vger.kernel.org Viresh Kumar wrote: > On 5 August 2014 01:46, Saravana Kannan wrote: >> The problem is when between one thread trying to cat a governor's file >> (say, >> sampling_rate) vs the governor getting a POLICY_EXIT. > > I don't see two threads racing against each other here. Simply changing > the governor from conservative->ondemand creates this. > > Or is it that the kernel is detecting two different orders of taking lock? > > But during governor change, isn't the sysfs lock taken first as we are > storing a value to "scaling_governor"? So, isn't this a sysfs lock first > in all cases? > > In short, I am still unclear about the *exact* problem here. > >> Could you please look at my policy free/remove patches? If you can do >> that, >> I can work on a fix for this. It might also be simpler to fix after my >> patch >> series (not sure, might be). > > I had an overall look of those on the day you posted them, but haven't > commented yet as was going away.. > > There is no way those can land in 3.17-rc1 atleast and so we still have > some time to get them pushed.. > > Anyway, they are my number two priority and the number one is this bug, > which we have to fix in stable kernels as well. So, a dependency on your > series wouldn't work.. Sigh... ok. I too will try to fix this one. I already have something in mind for this. Looks like Srivatsa has gone off the grid too. I'm hoping at least one of you can do a review of my series. Come on guys, not everyone has to work on the same patch/issue. :-( -Saravana -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation