From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752835AbbJMTr6 (ORCPT ); Tue, 13 Oct 2015 15:47:58 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34171 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752739AbbJMTr4 (ORCPT ); Tue, 13 Oct 2015 15:47:56 -0400 Subject: Re: [RFCv5 PATCH 40/46] sched/cpufreq_sched: compute freq_new based on capacity_orig_of() To: Juri Lelli , Peter Zijlstra , Michael Turquette References: <1436293469-25707-1-git-send-email-morten.rasmussen@arm.com> <1436293469-25707-41-git-send-email-morten.rasmussen@arm.com> <20150815124638.GG10304@worktop.programming.kicks-ass.net> <20150816040333.31346.22542@quantum> <20150816202401.GJ10304@worktop.programming.kicks-ass.net> <55D1D16F.1070106@arm.com> Cc: Morten Rasmussen , "mingo@redhat.com" , "vincent.guittot@linaro.org" , "daniel.lezcano@linaro.org" , Dietmar Eggemann , "yuyang.du@intel.com" , "rjw@rjwysocki.net" , "sgurrappadi@nvidia.com" , "pang.xunlei@zte.com.cn" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" From: Steve Muckle X-Enigmail-Draft-Status: N1110 Message-ID: <561D5FE9.2050503@linaro.org> Date: Tue, 13 Oct 2015 12:47:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55D1D16F.1070106@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/17/2015 05:19 AM, Juri Lelli wrote: >> Nah, just maybe: (capacity << SCHED_CAPACITY_SHIFT) / capacity_orig_of() >> > such that you don't have to export that knowledge to this thing. >> > > Oh, right. I guess we can just go with something like: > > req_cap = get_cpu_usage(cpu) * capacity_margin / capacity_orig_of(cpu); > > on fair.c side and switch back to > > freq_new = capacity * policy->max >> SCHED_CAPACITY_SHIFT; > > on cpufreq_sched.c side. That saves us exporting capacity_orig_of(). Another good reason to make this change - I believe the current code will not support a cpufreq policy covering CPUs of different types (such as a b.L system in a single frequency domain). The max requested capacity is calculated using the absolute/global capacity values requested from each CPU. A small CPU needing a higher OPP may get ignored because of a request from a big CPU for a lower OPP, because the big CPU @ lower OPP shows up as the max capacity request.