Received: by 10.213.65.68 with SMTP id h4csp3960133imn; Tue, 10 Apr 2018 07:13:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/5PPoDI/tZ7qZJz0IGyL/2Zqw36Rn7yF82sm8LPy0zbTkD/OB5fBLv47sOl+imibzP+GBV X-Received: by 2002:a17:902:581e:: with SMTP id m30-v6mr646293pli.406.1523369600279; Tue, 10 Apr 2018 07:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523369600; cv=none; d=google.com; s=arc-20160816; b=QQw/MRses5WWCO48Q0RdDIzwckNaTi2MbtgtzoF9f9o0oBHiJzeYE1nUQHifZJi7Xf uNqHSiaFRGPAhRTgKCFnuijAuKIlzbBo0YYWST/irOUcdMMdjXpXbyzpBsDT+oE8DK3X eJHMnYnPpf7rolvrap+XuQxNRhoKjaz8v9yeVjDJcL6M4XjuwNgmCQxI2tLfgSQhT+IS y9Cnms73MUbXO/ZPRNf9VnyTnmlOOcmrgud14mla+c0jSVZ919uFd9RbV45/KB+mSjvW 3fWAxvi9qmoJm2404ErkGJHFvphkwQD04DWT4T1BbkGLSMmPOlu9b1YFfLs3AeS6a+x7 ca3g== 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=uSPRzC/9Pq7rqgLqjqUPgiYg0Xa9+2gOyoxwES/t2po=; b=CnfP37YAxB7N0GB0WRVRGXfg2pJPjO4JSeVNLDBc0AwsPDjQORh8AYqlWX0vTEeRQr jduAzbeDxykQryJIivZL51IyVk5UNiR1jX8SA35BgUwvKJN9aK2+9GkZlPH5Ng95l/1P fzpQg3cE3+814ZFs1yGsV8nMn4hJ1IpgcDwb++XfrcBuaRXhPI2usHqyQQoIUKU0lBtq Kci23z6F2Or+sKsmmSzopHwgtcn5MLdNTIOhF5UFhD1gpSozQ49X5rdtkY0ZyGjtw28J J70JpdJfmLMU8CzCvB/j2XZ8jGdU9EY8u++OfaCI9zzawdki95QW/OnuXlcAqow8oVgF 1h+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ITMpiIpj; 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 u25si1828984pgo.388.2018.04.10.07.12.42; Tue, 10 Apr 2018 07:13:20 -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=merlin.20170209 header.b=ITMpiIpj; 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 S1753998AbeDJOJM (ORCPT + 99 others); Tue, 10 Apr 2018 10:09:12 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34828 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753256AbeDJOJJ (ORCPT ); Tue, 10 Apr 2018 10:09:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=uSPRzC/9Pq7rqgLqjqUPgiYg0Xa9+2gOyoxwES/t2po=; b=ITMpiIpj+5lfUfOuJ4JEwzW+i HpJBLK/ZGUw/JO57uu9beNvJX5IHXXd0oEi8dlIBH7TVMyWfkVS8ZHnUp/kc5OQxVnlQN/6+F8ZcQ RBufHcuTL+HtNkVots2G+4vPUc8tXzeX5uOfAS5VFb8UpHiXsgEgUdVjKDS8FKgvY91M3YZE9Dh25 uAMqZnEhfNAIb68S9Q4xhhLHJVOZfD3Y5j9/BO89CBDNrJd6XpcZfvGk2FXe0ixlaOOK5fYO8MVIR oWlOEbQsTtyntqxJ7hdSTNDE/xMjZPkSUyrUyadbQvBL0xNnhjHE6o1si7MX7ljLAkDAfBm74EpF5 U4Oenr+Vw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5txA-0003wL-IV; Tue, 10 Apr 2018 14:08:56 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 86D8D20298CF9; Tue, 10 Apr 2018 16:08:53 +0200 (CEST) Date: Tue, 10 Apr 2018 16:08:53 +0200 From: Peter Zijlstra To: Quentin Perret Cc: Dietmar Eggemann , linux-kernel@vger.kernel.org, Thara Gopinath , linux-pm@vger.kernel.org, Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Viresh Kumar , Todd Kjos , Joel Fernandes , Juri Lelli , Steve Muckle , Eduardo Valentin Subject: Re: [RFC PATCH v2 4/6] sched/fair: Introduce an energy estimation helper function Message-ID: <20180410140853.GG4082@hirez.programming.kicks-ass.net> References: <20180406153607.17815-1-dietmar.eggemann@arm.com> <20180406153607.17815-5-dietmar.eggemann@arm.com> <20180410125105.GC4043@hirez.programming.kicks-ass.net> <20180410135640.GB3866@e108498-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180410135640.GB3866@e108498-lin.cambridge.arm.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 02:56:41PM +0100, Quentin Perret wrote: > > So in the last thread there was some discussion about this; in > > particular on how this related to schedutil and if we should tie it into > > that. > > > > I think for starters tying it to schedutil is not a bad idea; ideally > > people _should_ migrate towards using that. > > > > Also; I think it makes sense to better integrate cpufreq and the > > energy-model values like what rjw already suggested, such that maybe we > > can have cpufreq_driver_resolve_freq() return a structure containing the > > relevant information for the selected frequency. > > I guess if we want to do that in the wake-up path, we would also need to > add a new parameter to it to make sure we don't actually call into > cpufreq_driver->resolve_freq() ... > > But then, we could sort of rely on cpufreq_schedutil.c::get_next_freq() > to replace find_cap_state() ... Is this what you had in mind ? Yes, something along those lines; we could also of course factor get_next_freq() into two parts. > > But implementing the frequency selection thing in multiple places like > > now sounds like a very bad idea to me. > > Understood. Making sure we share the same code everywhere might have > consequences though. I guess we'll have to either accept the cost of > function calls in the wake-up path, or to accept to inline those > functions for ex. Or maybe you had something else in mind ? > > Anyways, that's probably another good discussion topic for OSPM > next week :-) Yes, that wants a wee bit of discussion. Ideally we'd have a shared data structure we can iterate instead of a chain of indirect calls.