Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754391AbcCAO6r (ORCPT ); Tue, 1 Mar 2016 09:58:47 -0500 Received: from mail-lf0-f51.google.com ([209.85.215.51]:33867 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753745AbcCAO6p (ORCPT ); Tue, 1 Mar 2016 09:58:45 -0500 MIME-Version: 1.0 In-Reply-To: <20160301135811.GQ6356@twins.programming.kicks-ass.net> References: <56B93548.9090006@linaro.org> <5387313.xAhVpzgZCg@vostro.rjw.lan> <56BA8C29.4090905@linaro.org> <20160211115959.GI6357@twins.programming.kicks-ass.net> <20160211122429.GM11415@e106622-lin> <20160211152625.GM6357@twins.programming.kicks-ass.net> <20160212140415.GS6357@twins.programming.kicks-ass.net> <20160301135811.GQ6356@twins.programming.kicks-ass.net> From: Vincent Guittot Date: Tue, 1 Mar 2016 15:58:23 +0100 Message-ID: Subject: Re: [PATCH 0/3] cpufreq: Replace timers with utilization update callbacks To: Peter Zijlstra Cc: Juri Lelli , Steve Muckle , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux PM list , Linux Kernel Mailing List , Srinivas Pandruvada , Viresh Kumar , Thomas Gleixner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1948 Lines: 40 On 1 March 2016 at 14:58, Peter Zijlstra wrote: > On Fri, Feb 12, 2016 at 03:48:54PM +0100, Vincent Guittot wrote: > >> Another point to take into account is that the RT tasks will "steal" >> the compute capacity that has been requested by the cfs tasks. >> >> Let takes the example of a CPU with 3 OPP on which run 2 rt tasks A >> and B and 1 cfs task C. > >> Let assume that the real time constraint of RT task A is too agressive >> for the lowest OPP0 and that the change of the frequency of the core >> is too slow compare to this constraint but the real time constraint of >> RT task B can be handle whatever the OPP. System don't have other >> choice than setting the cpufreq min freq to OPP1 to be sure that >> constraint of task A will be covered at anytime. > >> Then, we still have 2 >> possible OPPs. The CFS task asks for compute capacity that fits in >> OPP1 but a part of this capacity will be stolen by RT tasks. If we >> monitor the load of RT tasks and request capacity for these RT tasks >> according to their current utilization, we can decide to switch to >> highest OPP2 to ensure that task C will have enough remaining >> capacity. A lot of embedded platform faces such kind of use cases > > Still doesn't make sense. How would you know the constraint of RT task > A, and that it cannot be satisfied by OPP0 ? The only information you > have in the task model is a static priority. The kernel doesn't have this information so that's why the sysfs cpufreq/scaling_min_freq has to be used to prevent the kernel (and cpufreq in particular) to use OPP0. >From a kernel/sched/cpufreq pov, we assume that all OPPs above cpufreq/scaling_min can be used with RT tasks of the system. And performance governor is used if only highest OPP can be used. > > The only possible choice the kernel has at this point is max OPP. It > doesn't have enough (_any_) information about worst case execution of > that task. >