From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992695AbcBSCia (ORCPT ); Thu, 18 Feb 2016 21:38:30 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35819 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1948026AbcBSCi2 (ORCPT ); Thu, 18 Feb 2016 21:38:28 -0500 Date: Fri, 19 Feb 2016 08:08:14 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List Subject: Re: [PATCH v2 12/12] cpufreq: governor: Narrow down the dbs_data_mutex coverage Message-ID: <20160219023814.GD16983@vireshk-i7> References: <2938006.67J0esUvOA@vostro.rjw.lan> <8616971.q0P8tF6lFz@vostro.rjw.lan> <20160218062040.GR2610@vireshk-i7> <2559441.qfMQ0Nj7fb@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2559441.qfMQ0Nj7fb@vostro.rjw.lan> 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 18-02-16, 18:58, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > Subject: [PATCH] cpufreq: governor: Narrow down the dbs_data_mutex coverage > > Since cpufreq_governor_dbs() is now always called with policy->rwsem > held, it cannot be executed twice in parallel for the same policy. > Thus it is not necessary to hold dbs_data_mutex around the invocations > of cpufreq_governor_start/stop/limits() from it as those functions > never modify any data that can be shared between different policies. > > However, cpufreq_governor_dbs() may be executed twice in parallal > for different policies using the same gov->gdbs_data object and > dbs_data_mutex is still necessary to protect that object against > concurrent updates. > > For this reason, narrow down the dbs_data_mutex locking to > cpufreq_governor_init/exit() where it is needed and rename the > mutex to gov_dbs_data_mutex to reflect its purpose. > > Signed-off-by: Rafael J. Wysocki > --- > drivers/cpufreq/cpufreq_governor.c | 46 ++++++++++++++++++------------------- > 1 file changed, 23 insertions(+), 23 deletions(-) Acked-by: Viresh Kumar -- viresh