From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934441AbcBDQqL (ORCPT ); Thu, 4 Feb 2016 11:46:11 -0500 Received: from mail-lb0-f196.google.com ([209.85.217.196]:32894 "EHLO mail-lb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932140AbcBDQqJ (ORCPT ); Thu, 4 Feb 2016 11:46:09 -0500 MIME-Version: 1.0 In-Reply-To: <20160204050954.GU3469@vireshk> References: <3705929.bslqXH980s@vostro.rjw.lan> <1529283.0IedZktI9q@vostro.rjw.lan> <20160204050954.GU3469@vireshk> Date: Thu, 4 Feb 2016 17:46:07 +0100 X-Google-Sender-Auth: 0rLzR8hW3rjec-QIJzmjvTcw7Hw Message-ID: Subject: Re: [PATCH 2/11] cpufreq: governor: Use common mutex for dbs_data protection From: "Rafael J. Wysocki" To: Viresh Kumar Cc: "Rafael J. Wysocki" , Linux PM list , Linux Kernel Mailing List , Srinivas Pandruvada , Juri Lelli , Steve Muckle , Saravana Kannan Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 4, 2016 at 6:09 AM, Viresh Kumar wrote: > On 04-02-16, 00:16, 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, >> those mutexes are never used at the same time > > Why do you think so? I thought they can always be used in parallel. > > Consider 2 or more policies, one can have ondemand as the governor, > whereas other one can have conservative. > > If CPUs go online/offline or if governors are switching in parallel, > then cpufreq_governor_dbs() can very much run in parallel for ondemand > and conservative. > > Or am I missing something here ? Well, so perhaps the changelog is inaccurate. However, what's wrong with using a single mutex then? Thanks, Rafael