Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760552AbcCDX5Y (ORCPT ); Fri, 4 Mar 2016 18:57:24 -0500 Received: from mail-qk0-f175.google.com ([209.85.220.175]:35366 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760382AbcCDX5V (ORCPT ); Fri, 4 Mar 2016 18:57:21 -0500 Subject: Re: [PATCH v2 6/10] cpufreq: Support for fast frequency switching To: "Rafael J. Wysocki" References: <2495375.dFbdlAZmA6@vostro.rjw.lan> <2409306.qzzMXcm4dm@vostro.rjw.lan> <15684081.T4iOMUSHCY@vostro.rjw.lan> <56DA09B1.4010005@linaro.org> Cc: "Rafael J. Wysocki" , Linux PM list , Juri Lelli , ACPI Devel Maling List , Linux Kernel Mailing List , Peter Zijlstra , Srinivas Pandruvada , Viresh Kumar , Vincent Guittot , Michael Turquette , Ingo Molnar From: Steve Muckle X-Enigmail-Draft-Status: N1110 Message-ID: <56DA20C0.1070803@linaro.org> Date: Fri, 4 Mar 2016 15:56:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1328 Lines: 30 On 03/04/2016 03:18 PM, Rafael J. Wysocki wrote: > In fact, the mechanism may be relatively simple if I'm not mistaken. > > In the "fast switch" case, the governor may spawn a work item that > will just execute cpufreq_get() on policy->cpu. That will notice that > policy->cur is different from the real current frequency and will > re-adjust. > > Of course, cpufreq_driver_fast_switch() will need to be modified so it > doesn't update policy->cur then perhaps with a comment that the > governor using it will be responsible for that. > > And the governor will need to avoid spawning that work item too often > (basically, if one has been spawned already and hasn't completed, no > need to spawn a new one, and maybe rate-limit it?), but all that looks > reasonably straightforward. It is another option though definitely a compromise. The semantics seem different since you'd potentially have multiple freq changes before a single notifier went through, so stuff might still break. The fast path would also be more expensive given the workqueue activity that could translate into additional task wakeups. Honestly I wonder if it's better to just try the "no notifiers with fast drivers" approach to start. The notifiers could always be added if platform owners complain that they absolutely require them. thanks, Steve