From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Turquette Subject: Re: [RFCv7 PATCH 02/10] cpufreq: introduce cpufreq_driver_is_slow Date: Thu, 25 Feb 2016 16:50:29 -0800 Message-ID: <20160226005029.2278.38972@quark.deferred.io> References: <1456190570-4475-1-git-send-email-smuckle@linaro.org> <1456190570-4475-3-git-send-email-smuckle@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Return-path: Received: from mail-pa0-f46.google.com ([209.85.220.46]:34874 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753155AbcBZBAU convert rfc822-to-8bit (ORCPT ); Thu, 25 Feb 2016 20:00:20 -0500 Received: by mail-pa0-f46.google.com with SMTP id ho8so42410557pac.2 for ; Thu, 25 Feb 2016 17:00:20 -0800 (PST) In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Steve Muckle Cc: Peter Zijlstra , Ingo Molnar , "Rafael J. Wysocki" , Linux Kernel Mailing List , "linux-pm@vger.kernel.org" , Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Juri Lelli , Patrick Bellasi , Viresh Kumar Quoting Rafael J. Wysocki (2016-02-22 17:31:09) > On Tue, Feb 23, 2016 at 2:22 AM, Steve Muckle wrote: > > From: Michael Turquette > > > > Some architectures and platforms perform CPU frequency transitions > > through a non-blocking method, while some might block or sleep. Even > > when frequency transitions do not block or sleep they may be very slow. > > This distinction is important when trying to change frequency from > > a non-interruptible context in a scheduler hot path. > > > > Describe this distinction with a cpufreq driver flag, > > CPUFREQ_DRIVER_FAST. The default is to not have this flag set, > > thus erring on the side of caution. > > > > cpufreq_driver_is_slow() is also introduced in this patch. Setting > > the above flag will allow this function to return false. > > > > [smuckle@linaro.org: change flag/API to include drivers that are too > > slow for scheduler hot paths, in addition to those that block/sleep] > > > > Cc: Rafael J. Wysocki > > Cc: Viresh Kumar > > Signed-off-by: Michael Turquette > > Signed-off-by: Steve Muckle > > Something more sophisticated than this is needed, because one driver > may actually be able to do "fast" switching in some cases and may not > be able to do that in other cases. Those drivers can set the flag dynamically when they probe based on their ACPI tables. > > For example, in the acpi-cpufreq case all depends on what's there in > the ACPI tables. It's all a moot point until the locking in cpufreq is changed. Until those changes are made it is a bad idea to call cpufreq_driver_target() from schedule() context, regardless of the underlying hardware, and all platforms should kick that work out to the kthread. Regards, Mike > > Thanks, > Rafael