From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752450AbcBOIwc (ORCPT ); Mon, 15 Feb 2016 03:52:32 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:36216 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752239AbcBOIwb (ORCPT ); Mon, 15 Feb 2016 03:52:31 -0500 Date: Mon, 15 Feb 2016 14:22:22 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List , Juri Lelli Subject: Re: [PATCH 5/9] cpufreq: governor: Get rid of the ->gov_check_cpu callback Message-ID: <20160215085222.GM6334@vireshk-i7> References: <3329748.lhJgppdTt9@vostro.rjw.lan> <9111131.hox2j3ReJb@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9111131.hox2j3ReJb@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 15-02-16, 02:19, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > The way the ->gov_check_cpu governor callback is used by the ondemand > and conservative governors is not really straightforward. Namely, the > governor calls dbs_check_cpu() that updates the load information for > the policy and the invokes ->gov_check_cpu() for the governor. > > To get rid of that entanglement, notice that cpufreq_governor_limits() > doesn't need to call dbs_check_cpu() directly. Instead, it can simply > reset the sample delay to 0 which will cause a sample to be taken > immediately. The result of that is practically equivalent to calling > dbs_check_cpu() except that it will trigger a full update of governor > internal state and not just the ->gov_check_cpu() part. > > Following that observation, make cpufreq_governor_limits() reset > the sample delay and turn dbs_check_cpu() into a function that will > simply evaluate the load and return the result called dbs_update(). > > That function can now be called by governors from the routines that > previously were pointed to by ->gov_check_cpu and those routines > can be called directly by each governor instead of dbs_check_cpu(). > This way ->gov_check_cpu becomes unnecessary, so drop it. > > Signed-off-by: Rafael J. Wysocki > --- > drivers/cpufreq/cpufreq_conservative.c | 26 +++++++++----------------- > drivers/cpufreq/cpufreq_governor.c | 15 ++++++++------- > drivers/cpufreq/cpufreq_governor.h | 3 +-- > drivers/cpufreq/cpufreq_ondemand.c | 15 +++++++++------ > 4 files changed, 27 insertions(+), 32 deletions(-) Acked-by: Viresh Kumar -- viresh