From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA9EBCA9EA3 for ; Fri, 18 Oct 2019 08:12:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4E812064A for ; Fri, 18 Oct 2019 08:12:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="X4HC/htE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395502AbfJRIME (ORCPT ); Fri, 18 Oct 2019 04:12:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53016 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727918AbfJRIME (ORCPT ); Fri, 18 Oct 2019 04:12:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tA/jFxjvIHq0tQ9bAEhe6lZyldnVuvn0ypIwLrAbRC8=; b=X4HC/htEf84+RawY1Xmok8qZZ nfVykWThT6oMbX6rJ8l2fPLcdqiZz4H2ZFz5IaEHEPBZSFq1P6vOUyMi+8II/FXRzscg4tVV5PSfK QmkF7NRenb8zMCgnJAWWdyH53N7T7lXnyQ7Jr2JDim2G9FsS0EvtTIKSt66v5LSThomRjm0DCACcC atVs2UPy2xqCs+jUEGsHepUH8kz+iCrb2e5dNXNwV3tIgKGPQ0VnQ0LD0K9hoPnPlMyZBOrZvryV4 WuNIA0usVXeywej/s7pTKU2QM1tt7BqTD/NXyww5x5nIraTE2nkj98LzZy2QFnE9K0Z1HR7wQXQoY nclXpC0JA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLNMZ-0001bB-Lx; Fri, 18 Oct 2019 08:11:55 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 000E630018A; Fri, 18 Oct 2019 10:10:57 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A2F99200DE9FA; Fri, 18 Oct 2019 10:11:53 +0200 (CEST) Date: Fri, 18 Oct 2019 10:11:53 +0200 From: Peter Zijlstra To: Dietmar Eggemann Cc: Quentin Perret , Douglas Raillard , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, mingo@redhat.com, rjw@rjwysocki.net, viresh.kumar@linaro.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, qperret@qperret.net, patrick.bellasi@matbug.net, dh.han@samsung.com Subject: Re: [RFC PATCH v3 0/6] sched/cpufreq: Make schedutil energy aware Message-ID: <20191018081153.GE2328@hirez.programming.kicks-ass.net> References: <20191011134500.235736-1-douglas.raillard@arm.com> <20191014145315.GZ2311@hirez.programming.kicks-ass.net> <20191017095015.GI2311@hirez.programming.kicks-ass.net> <20191017111116.GA27006@google.com> <20191017141107.GJ2311@hirez.programming.kicks-ass.net> <2cbde0fe-c10c-0ebb-32ef-2d522986bc89@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2cbde0fe-c10c-0ebb-32ef-2d522986bc89@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 18, 2019 at 09:44:44AM +0200, Dietmar Eggemann wrote: > On 17/10/2019 16:11, Peter Zijlstra wrote: > > On Thu, Oct 17, 2019 at 12:11:16PM +0100, Quentin Perret wrote: > > [...] > > > It only boosts when 'rq->cfs.avg.util' increases while > > 'rq->cfs.avg.util_est.enqueued' remains unchanged (and util > util_est > > obv). > > > > This condition can be true for select_task_rq_fair(), because that is > > ran before we do enqueue_task_fair() (for obvious raisins). > > > >>> I'm still thinking about the exact means you're using to raise C; that > >>> is, the 'util - util_est' as cost_margin. It hurts my brain still. > >> > >> +1 ... > > > > cost_i = capacity_i / power_i ; for the i-th OPP > > I get confused by this definition. efficiency=capacity/power but the > cs->cost value used in em_pd_get_higher_freq() is defined as > > cs_cost = cs->power * cpu_max_freq / cs->freq [energy_model.h] cost_i = power_i * f_max / f_i cost(x) = cost_j * (1 + x) ; f_j >= min_freq cost_k <= cost(x) P = C*V^2*f, V ~ f -> P ~ f^3 cost_i ~ f_i^3 * f_max / f_i = f_i^2 * f_max cost(x) = (1 + x) * f_j^2 * f_max cost_k = cost(x) f_k^2 * f_max = (1 + x) * f_j^2 * f_max f_k = sqrt(1 + x) * f_j Which does indeed make more sense... However, I still struggle with using our 'x = util - util_est' as input for an OPP specific increase.