Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1716893ybg; Sat, 19 Oct 2019 00:59:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTPDoVEcFKtOBuUfgQU/m6nONvKoZzp0eiyTQ0/Hcabg8LZx4QbbWCIQfH2Be0RMniRG8B X-Received: by 2002:a50:b966:: with SMTP id m93mr13795721ede.228.1571471992596; Sat, 19 Oct 2019 00:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571471992; cv=none; d=google.com; s=arc-20160816; b=yVfwjGSiyt2dJSFdukPJj74uoJvkx8hS3elb46fGkPI+qJE1XbxEvi4QBGf/l2+Afx RueItJ3Ktc618yQCz/RrEQGRnloch9is+lXfcG+JIfdXy3456kS1Me34aReP8uV12IqO pGZ3ugUBs8LdMtHOvg3hSmCMkvFOFHlV2wBwAZDR1NCMbLBWnWJQDR59+lEVvWmKCAHV GW6XD8oUzEs0eZhca3eed2MhxIwj1fMq27PtIjVHAh+8vsC32NOo44sCr0ShKN9RLqPJ ImMyQj5yLtfIOpbes/13a2uSk6HXb463JfCmtuhHMeJXVTg7R1FSaYRTVRWh/TEKlklH Yxlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tA/jFxjvIHq0tQ9bAEhe6lZyldnVuvn0ypIwLrAbRC8=; b=DBsQ4gX9U2GPwc3D7BPdc8CCpVexNjBmegB5wiZ6RQgRIJcF5STr2h7dAuLuRnHG44 ZdpnCJi2e8NFLxppl5DKtFJXiU8aHIexgIOZi35BBDv0/YISp6Jk0v7JA92bQv0BIxAL w0L7Irb+62q6LunqBulYXVUPJ5BZij4t25txwQymM92jGKb2FRiyF80K1JMc3FpDqKUy IF5V6SRu+GSebjsU5VVcKXF38zkXyTfQeno5w1BAL0vQCcGQDoiUWUF39H1gSdeT8ytg hQT0SzmnqNwbioXC3WyiYgZP7XvfmTrAX0Fpluh3OB2lODGACbnxFSpQhCBqA00mA/wo vx4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="X4HC/htE"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p38si5505087edc.449.2019.10.19.00.59.29; Sat, 19 Oct 2019 00:59:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="X4HC/htE"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394927AbfJRIME (ORCPT + 99 others); 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.