Received: by 10.213.65.68 with SMTP id h4csp1414891imn; Wed, 21 Mar 2018 10:05:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELvqk6BxDrR/m5AVRuqFH6iCMcX+t++FdwnGSbmsrE/BE59vyJ//7+WbGsZ7JKVUMtc7sHe0 X-Received: by 2002:a17:902:aa83:: with SMTP id d3-v6mr21129320plr.36.1521651906794; Wed, 21 Mar 2018 10:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521651906; cv=none; d=google.com; s=arc-20160816; b=kp/zlW497qXBNYAFkwLDxkh+W0uiAQ+3YHAP11ZDqgZOnCI9JIr/2l8iwbo+YXm3QC MokfrzsrbeHYEMri5CIkCR/uUQNFvo03yhLpZEaPpzL1iwZRArgmkOaIjn3LLUmus8PP mOP1t58X1dmycFZ/WVoXP+iFHT2xkhOF1T3Y9iac6PURthvfUSu5NU58ABF8T3DJ1KIU aWvIUnIhdKjTVQcP6ZHQQKzrtY7kCVlJWD5CcfaBQTilE3lJq4z5l54qPLwqdcq6IMoI iuqZ94NKFG3MPNdhBG4cwn/5A1lMYAOr3ZHMEIrYnZeqQ+CEZ+Azy/dP94Pv/tlkx9gR urkQ== 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:arc-authentication-results; bh=5V8NQyl8f2LhuYchca1DugHrQj/udbEd9qkoVMwbOQ4=; b=fD+nDNzlevY3IFbCEBacGTJEkjFUvb029MLbnY7pVj5x4YWBiioJcXi3bFfSzUF0pe BmUskmIul1Hs3wfchPuKdjmUZuSOEzACItAHatSLY4wP5Ss8y24ELpc3xNoDHpzLhywK isfkAyiroo6V3TyNqoeikUJT+2KcJaaXMqj+i5S/eXy8TqEEPfd0/pdIfxiIxXoMsYBH cjRplcnNgn9Gd97xU15sS1Ja/5euavdxSF8BaGfYE6fCixfB/C+hvTmV5amfaoI7kIaA y6Tka7qjRd/J02ullqkF2JmE1ejSv1CZWeZ6gXzp+nnI1vCrlSIWArQ73brnKtrqOdvH nscw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BIZSo3OT; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35-v6si4341045plh.84.2018.03.21.10.04.33; Wed, 21 Mar 2018 10:05:06 -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=pass header.i=@gmail.com header.s=20161025 header.b=BIZSo3OT; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752230AbeCURDJ (ORCPT + 99 others); Wed, 21 Mar 2018 13:03:09 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33526 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751548AbeCURDH (ORCPT ); Wed, 21 Mar 2018 13:03:07 -0400 Received: by mail-wm0-f67.google.com with SMTP id i189so7273119wmf.0; Wed, 21 Mar 2018 10:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5V8NQyl8f2LhuYchca1DugHrQj/udbEd9qkoVMwbOQ4=; b=BIZSo3OTF4NzjWj+7YCcipqmS/Xl+bjUqXGPp1exa7hsvhxh0KzU9BVyNzV2KdVLfb N3mY8gO94EiZY6zOU7Y003G35SlV0XisYiXYwucghNHdToJUoBKhlM++dcqLXYkrR7kS Y23/GRJhBWcBe9GBq9SMW/On5d5w/SMHDjTefXlNiz7GsJ7w8C/H/tv3slWa7G9ezupc qwmUptKLgPMfGrRSkTwQE2rKYg0dHwtk+cQaVZhh1S/PEow0qCm0oB6kvbvh8L/UuVA6 f4EF0yh9dxVjRE8zgXfPXnmooZWj1XuxdX9NHI2ZQvNGp6jpoa7+v8KMVdetFsugz91q ya9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5V8NQyl8f2LhuYchca1DugHrQj/udbEd9qkoVMwbOQ4=; b=tkVEd91Ozzi9IrWhno6G1+1y2NgmRqJSNAA5E+9RfYjmS2MhtrXM3qoB0FNf44paNc kES5YOLjU7itjip0fg0QaDWIKVqzjc+3LiTt8lr4QXkqZwPKvlGDOSvUa3kPVaqPUqKD GQbOXVURWwgBYfmiPUEAG2e37HYa7DCbb77sJKTSwsVyJiKMI9DuUoDIuoHHxo0Lqnre ybSKYrxk9pFHmlQtMFks/RIz3TIaFK4ejVDYvj0tYZfGfqu+dyAX2pIKRKY02dLvvddF ZV3w2NxKh9Mo9IZgOzZ+6j3DIXkNhJjNy04eEjrSX2OUOrf9/E+7iquOb+aukaevyC3u QEMw== X-Gm-Message-State: AElRT7GLoocbZKN0HRBg9CVtgsn+EtxTmmyCKODhnU4nYtgcNhtwyWoe uY3HgeqcPtqzqvfNDPiU6UA= X-Received: by 10.28.106.19 with SMTP id f19mr3478275wmc.84.1521651785594; Wed, 21 Mar 2018 10:03:05 -0700 (PDT) Received: from localhost.localdomain ([151.15.242.31]) by smtp.gmail.com with ESMTPSA id i200sm3657392wmf.0.2018.03.21.10.03.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 10:03:02 -0700 (PDT) Date: Wed, 21 Mar 2018 18:02:59 +0100 From: Juri Lelli To: Morten Rasmussen Cc: Quentin Perret , Patrick Bellasi , Dietmar Eggemann , linux-kernel@vger.kernel.org, Peter Zijlstra , Thara Gopinath , linux-pm@vger.kernel.org, Chris Redpath , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Viresh Kumar , Todd Kjos , Joel Fernandes Subject: Re: [RFC PATCH 4/6] sched/fair: Introduce an energy estimation helper function Message-ID: <20180321170259.GG15165@localhost.localdomain> References: <20180320094312.24081-1-dietmar.eggemann@arm.com> <20180320094312.24081-5-dietmar.eggemann@arm.com> <20180321090430.GA6913@localhost.localdomain> <20180321122621.GA13951@e110439-lin> <20180321125925.GB15165@localhost.localdomain> <20180321135557.GB1373@queper01-VirtualBox> <20180321151513.GE15165@localhost.localdomain> <20180321162605.GO4589@e105550-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180321162605.GO4589@e105550-lin.cambridge.arm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/03/18 16:26, Morten Rasmussen wrote: > On Wed, Mar 21, 2018 at 04:15:13PM +0100, Juri Lelli wrote: > > On 21/03/18 13:55, Quentin Perret wrote: > > > On Wednesday 21 Mar 2018 at 13:59:25 (+0100), Juri Lelli wrote: > > > > On 21/03/18 12:26, Patrick Bellasi wrote: > > > > > On 21-Mar 10:04, Juri Lelli wrote: > > > > [...] > > > > > > > > > + /* > > > > > > > + * As the goal is to estimate the OPP reached for a specific util > > > > > > > + * value, mimic the behaviour of schedutil with a 1.25 coefficient > > > > > > > + */ > > > > > > > + util += util >> 2; > > > > > > > > > > > > What about other governors (ondemand for example). Is this supposed to > > > > > > work only when schedutil is in use (if so we should probably make it > > > > > > conditional on that)? > > > > > > > > > > Yes, I would say that EAS mostly makes sense when you have a "minimum" > > > > > control on OPPs... otherwise all the energy estimations are really > > > > > fuzzy. > > > > > > > > Make sense to me. Shouldn't we then make all this conditional on using > > > > schedutil? > > > > > > So, in theory, EAS could make sense even for other governors than > > > schedutil. Even with the performance governor it is probably more > > > energy efficient (although users using "performance" probably don't care > > > about energy, but that's just an example) to place small tasks onto little > > > CPUs up to a certain point given by the energy model. The ideal solution > > > would be to change the behaviour of find_cap_state() depending on the > > > governor being used, but I don't know if this extra complexity is worth > > > it really. > > > I'm happy to make all this conditional on schedutil as a first step and > > > we can see later if that makes sense to extend EAS to other use-cases. > > > > I agree that EAS makes still sense even for !schedutil cases (your > > performance example being one of them, powersave maybe another one?). > > Making it work with ondemand is tricky, though. > > > > So, not sure what's the best thing to do, but we should be at least aware > > of limitations. > > I would suggest making as few assumptions about the OPP selection as > possible. Even when we do use schedutil, there could be number of > reasons why we don't actually get the OPP schedutil requests (thermal, > hardware-says-no,...). > > In the previous energy model-driven scheduling postings, years back, I > went with the assumption that OPP would follow the utilization. So if we > put more tasks on a cpu, the OPP would increase to match. If cpufreq or > hardware decided to go faster, that is fine but it could lead to > suboptimal decisions. > > We could call into schedutil somehow to make sure that we at least > request the same OPP as the energy model assumes if the overhead is > small and we can present schedutil with all the information it needs to > choose the OPP for the proposed task placement. I wonder if it is worth > it, or if we should just decide on a simple assumption on OPP selection > for energy estimation and stick it in a comment. Right, I see your point. Refactoring the 1.25 coefficient calculation in some getter method shouldn't hopefully add much overhead, but yes, it might not give us much in terms of correctness for certain situations. Best, - Juri