From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875AbcBEGxp (ORCPT ); Fri, 5 Feb 2016 01:53:45 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35408 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbcBEGxo (ORCPT ); Fri, 5 Feb 2016 01:53:44 -0500 Date: Fri, 5 Feb 2016 12:23:41 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List , Srinivas Pandruvada , Juri Lelli , Steve Muckle , Saravana Kannan Subject: Re: [PATCH v2 2/10] cpufreq: governor: Use common mutex for dbs_data protection Message-ID: <20160205065341.GE21792@vireshk> References: <3705929.bslqXH980s@vostro.rjw.lan> <9008098.QDD8C89zDx@vostro.rjw.lan> <76588769.1gWBaNHTiQ@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <76588769.1gWBaNHTiQ@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 05-02-16, 03:14, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Every governor relying on the common code in cpufreq_governor.c > has to provide its own mutex in struct common_dbs_data. However, > there actually is no need to have a separate mutex per governor > for this purpose, they may be using the same global mutex just > fine. Accordingly, introduce a single common mutex for that and > drop the mutex field from struct common_dbs_data. > > That at least will ensure that the mutex is always present and > initialized regardless of what the particular governors do. > > Another benefit is that the common code does not need a pointer to > a governor-related structure to get to the mutex which sometimes > helps. > > Finally, it makes the code generally easier to follow. > > Signed-off-by: Rafael J. Wysocki > Acked-by: Saravana Kannan Acked-by: Viresh Kumar -- viresh