From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965321AbcFMLI5 (ORCPT ); Mon, 13 Jun 2016 07:08:57 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:35788 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965099AbcFMLIz (ORCPT ); Mon, 13 Jun 2016 07:08:55 -0400 Date: Mon, 13 Jun 2016 16:38:51 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List , Srinivas Pandruvada Subject: Re: [PATCH] cpufreq: conservative: Do not use transition notifications Message-ID: <20160613110851.GT27439@vireshk-i7> References: <2899343.d3UcWvo4TA@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2899343.d3UcWvo4TA@vostro.rjw.lan> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10-06-16, 03:00, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > The conservative governor registers a transition notifier so it > can update its internal requested_freq value if it falls out of the > policy->min...policy->max range, but that's not the most > straightforward way to achieve that. > > To do it in a more straightforward way, first make sure that > cs_dbs_timer() will only set frequencies between min and max. > > With that, note that requested_freq will always fall between min > and max unless either policy->min or policy->max changes and the > governor's ->limits() callback will be invoked then. > > Using this observation, add a ->limits callback pointer to > struct dbs_governor, make cpufreq_dbs_governor_limits() invoke > that callback if present, implement that callback in the conservative > governor to update requested_freq if needed and drop the transition > notifier from it, which also makes it possible to drop the > struct cs_governor definition from there and simplify the code > accordingly. This code looks to me over-complicated and I am not sure if I understand why we wanted the notifiers anyway? Why can't we replace 'dbs_info->requested_freq' with 'policy->cur' and kill the notifier thing completely? With requested_freq, we are trying to set the next freq to requested_freq +- Delta, which I am not sure is the best approach here. What would go wrong if we will do, policy->cur +- delta instead? The notifiers were added long back, to solve a problem which I don't think will exist if we use policy->cur everywhere instead: commit a8d7c3bc2396 ("[CPUFREQ] Make cpufreq_conservative handle out-of-sync events properly") Am I missing something? -- viresh