Received: by 10.213.65.68 with SMTP id h4csp3860325imn; Tue, 10 Apr 2018 05:54:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx49MkaJH5z3EOhje9VjpAsZhkjCN0ita5jsgZxG4VOoQeXkiwf2cAwc3XVhkNya1qfRaeTGN X-Received: by 10.101.73.74 with SMTP id q10mr197301pgs.323.1523364869980; Tue, 10 Apr 2018 05:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523364869; cv=none; d=google.com; s=arc-20160816; b=GuxIqjNC+qM6GkAyhicw3DgaOZYvwBhX+vp/BttIXl8xd9MfCdSzzq0B5JbMAnKU8A wDkYUDoJh375UJDVcgbg2QuOerzGsiGbvS4htGE5tJKxfEvQeFm5gPUBpJyn5TN4Fw3k 7V0pf/2QF+JB2HlgP6ZiGzet5jbnZ/p+inlGtYW0PO/uraQo0b9ik1l8YiHkoJ7IFmfK irnjl1q/aTltKDHqqt98B4yEBQSdmtnyJzHtUA52j9omS8aRFE7cAv2+RV7LXYhkexqJ r9KjnN++rV2nHphTAXiu9EA+6oyb8F3kZXSpmCew5sr9+B/xDJd25dFDfIV3U6ed9nRQ mKnQ== 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=OxWo1IavWEsr0GohNXYjuAYQxL6FF9E3AstdyXvjVRc=; b=C48nco5slf4sxHTmRRgUhWJO+4ilcqx+qLd2A/CzS3Ene16IbhtM2Y9lAOefzAUYg6 amnMDsI/p6JUrXvEU+a9m0qTgl2H2btulKQDFuhKaKSlK6dwV2KcQMngOSCXVxv9wDDk e0O+qvjn1tv9op+4L1aDNpM6Tl8qwBIZePTdltbfF6VEA8T7lVJZXrj4x8cGKey6vKB6 4wUbvOwii7o31T9J3hFUPNcO5Bct7zyPs2W/GbqLAN2t/sMW8pqa3CHFUHHZdNYOYMxD RpQwj0TUSUrYJjHDMackq2o+UKxr6zUfmNyNAt4SszVpUkr7fGJ2462KxrIJLuZOj16r B7Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=TPEYXcqi; 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 m9-v6si2696669pll.67.2018.04.10.05.53.52; Tue, 10 Apr 2018 05:54:29 -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=TPEYXcqi; 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 S1752859AbeDJMvT (ORCPT + 99 others); Tue, 10 Apr 2018 08:51:19 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33708 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752585AbeDJMvS (ORCPT ); Tue, 10 Apr 2018 08:51:18 -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=OxWo1IavWEsr0GohNXYjuAYQxL6FF9E3AstdyXvjVRc=; b=TPEYXcqi8QCGzWYJRFJNso2ep XElwLmC3NjzFGzcI/zgvwNcaPjD1B10gxQC2v06YC/MpzTRqBtRyNnZo9URpRp5V5JSxxm4F55TV/ IxjnU7FVb8DAN86/ZpybdzjwiooaieQeJd05+47qGKAOLBYYFZmgaTJDrbGYYMNsehV1mUgPXu5k8 YAxHxp3RRzx8CIzVYK+p2T3w5VC7c+UvEFitaVinvPxH/rX5DwBLA1lShuzknye3Mj/GVyiu3FjB3 NEmgqiPCzbBfNtSOMjxbQ5boazEOv9znrRjUd4W61NdYIenuF+nHXs57njWihMwR9f01GJHPIx5UD leIWGKaKw==; 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 1f5sjr-0002lY-5K; Tue, 10 Apr 2018 12:51:07 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 906DC202A29FD; Tue, 10 Apr 2018 14:51:05 +0200 (CEST) Date: Tue, 10 Apr 2018 14:51:05 +0200 From: Peter Zijlstra To: Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, Quentin Perret , 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: <20180410125105.GC4043@hirez.programming.kicks-ass.net> References: <20180406153607.17815-1-dietmar.eggemann@arm.com> <20180406153607.17815-5-dietmar.eggemann@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180406153607.17815-5-dietmar.eggemann@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 Fri, Apr 06, 2018 at 04:36:05PM +0100, Dietmar Eggemann wrote: > +static inline > +struct capacity_state *find_cap_state(int cpu, unsigned long util) > +{ > + struct sched_energy_model *em = *per_cpu_ptr(energy_model, cpu); > + struct capacity_state *cs = NULL; > + int i; > + > + util += util >> 2; > + > + for (i = 0; i < em->nr_cap_states; i++) { > + cs = &em->cap_states[i]; > + if (cs->cap >= util) > + break; > + } > + > + return cs; > +} 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. But implementing the frequency selection thing in multiple places like now sounds like a very bad idea to me.