From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Muckle Subject: Re: [Update][PATCH v7 7/7] cpufreq: schedutil: New governor based on scheduler utilization data Date: Wed, 30 Mar 2016 10:05:55 -0700 Message-ID: <56FC0773.6060605@linaro.org> References: <7262976.zPkLj56ATU@vostro.rjw.lan> <6666532.7ULg06hQ7e@vostro.rjw.lan> <145931680.Kk1xSBT0Ro@vostro.rjw.lan> <20160330053011.GF8773@vireshk-i7> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pf0-f178.google.com ([209.85.192.178]:32848 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754898AbcC3RF6 (ORCPT ); Wed, 30 Mar 2016 13:05:58 -0400 Received: by mail-pf0-f178.google.com with SMTP id 4so47686888pfd.0 for ; Wed, 30 Mar 2016 10:05:57 -0700 (PDT) In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: "Rafael J. Wysocki" , Viresh Kumar Cc: "Rafael J. Wysocki" , Linux PM list , Juri Lelli , ACPI Devel Maling List , Linux Kernel Mailing List , Peter Zijlstra , Srinivas Pandruvada , Vincent Guittot , Michael Turquette , Ingo Molnar On 03/30/2016 04:31 AM, Rafael J. Wysocki wrote: >>> >> +static int sugov_limits(struct cpufreq_policy *policy) >>> >> +{ >>> >> + struct sugov_policy *sg_policy = policy->governor_data; >>> >> + >>> >> + if (!policy->fast_switch_enabled) { >>> >> + mutex_lock(&sg_policy->work_lock); >>> >> + >>> >> + if (policy->max < policy->cur) >>> >> + __cpufreq_driver_target(policy, policy->max, >>> >> + CPUFREQ_RELATION_H); >>> >> + else if (policy->min > policy->cur) >>> >> + __cpufreq_driver_target(policy, policy->min, >>> >> + CPUFREQ_RELATION_L); >>> >> + >>> >> + mutex_unlock(&sg_policy->work_lock); >>> >> + } >>> >> + >>> >> + sg_policy->need_freq_update = true; >> > >> > I am wondering why we need to do this for !fast_switch_enabled case? > > That will cause the rate limit to be ignored in the utilization update > handler which may be necessary if it is set to a relatively large > value (like 1 s). But why is that necessary for !fast_switch_enabled? In that case the frequency has been adjusted to satisfy the new limits here, so ignoring the rate limit shouldn't be necessary. In other words why not } else { sg_policy->need_freq_update = true; }