Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5372828imm; Tue, 19 Jun 2018 09:22:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKwEK9RI4KU3b6iPmQkNaxQ/vhG/0nJ2kMA+Qw8oRHX8gS3Lm4m2nCW9SmTOXPJSmJ4rzOF X-Received: by 2002:a62:8552:: with SMTP id u79-v6mr18956040pfd.201.1529425325737; Tue, 19 Jun 2018 09:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529425325; cv=none; d=google.com; s=arc-20160816; b=cMhU8e8Fpx02DIskxKw7822wcIIt7BLhj9pWCcyQIfu1AfOf4SiHUFo4DCaqpYKxq6 PwjvfugE9xBQhhLV5RPNAghu9nYz0sBPdbGt4LDgFBLCD1ls+0lI1f/cq3a3FdldBznR blu2v7zQOHK9Zo7hgeJR7SPtpA/k2JjInPs97dyFqipbj3kjYCTRfZMeXP2uuViChRgP UuskVfSWd7IgU81pvAfHHCDzLdeoK9J1GfRCW2e4KEo1yomDJS+Hr3Lp/HoSzkZ/hpNn HylU4xZpNBy+znspWT/42xGAefL8rlj6iknlVgIMX+MvcQpml+VZdbQ0d+GBLEcVdtHR +8eA== 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=FkFY/njUBC8BUERXpPyVsL5EYTnXxjo21r7S0mmXik8=; b=nANpOQvAhGHEDE9e8koKxVr2z7day8jEUV7JysatcMyGQAMqLgWU8Vk1avvQrZvsix arHKyHHJK9DXLWH5yNvMfaTNbI45r3aFBaNAaLtQ3w1swE6KwfXc1xx9LOg8FodRI3Tz c582/kzEMkuJZXHKJnJJEetXh//zxl7/oJZkbgRpuRkC4978Jj+50qaI5P4zXwUqD4Hu SE/UKT96szpqQVJIswiOV7WLtRQ2gSiOzZn/9g5v7ZqwQRc5GvoqCcKHfmZO86ziAQwp eexRVE6W6/K1VPI9zZ893fhWUzwJ1ZQx8u0RYOrPlwjeNENe+gbCBC1rEbDa+7ZdoBv8 +Now== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=LunzgRMS; 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 z3-v6si49103plb.228.2018.06.19.09.21.51; Tue, 19 Jun 2018 09:22:05 -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=LunzgRMS; 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 S966956AbeFSQVN (ORCPT + 99 others); Tue, 19 Jun 2018 12:21:13 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54252 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966646AbeFSQVI (ORCPT ); Tue, 19 Jun 2018 12:21:08 -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=FkFY/njUBC8BUERXpPyVsL5EYTnXxjo21r7S0mmXik8=; b=LunzgRMSzDVW984GLofwv2Bh8 k2dbp4wtIplhFAQjb7iHigAHbKraZ6JBaW21Zg4gsh7thYDJaFBYRtUtoMZjBffeI3qYP5ayVc5C2 3/k6fmFGuAp8uHlqfwlqRw6mKBcOJTZ4b9V4BFZLxom45Yfj6lL0pRUW7eWLcJVMDs62q/VPTpKeI Dn2OSxKfOiHFF6Wd9lq0Rvo/jW0GgBdLz3sax/J11WHqsviQr1Duf4lAR8MHEA1yhsLQI5I5r61sD Khbbn7mhilcrPRA0UAxKSDRGv1QRKDBb83x4meEsHhZOuc7UCdDUUbCGKlX0hTL6ZLBy5yRlQl7s2 uae2THwng==; 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 1fVJN7-0005XO-7j; Tue, 19 Jun 2018 16:20:45 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A16A820298BAC; Tue, 19 Jun 2018 18:20:42 +0200 (CEST) Date: Tue, 19 Jun 2018 18:20:42 +0200 From: Peter Zijlstra To: Quentin Perret Cc: rjw@rjwysocki.net, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, mingo@redhat.com, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, chris.redpath@arm.com, patrick.bellasi@arm.com, valentin.schneider@arm.com, vincent.guittot@linaro.org, thara.gopinath@linaro.org, viresh.kumar@linaro.org, tkjos@google.com, joelaf@google.com, smuckle@google.com, adharmap@quicinc.com, skannan@quicinc.com, pkondeti@codeaurora.org, juri.lelli@redhat.com, edubezval@gmail.com, srinivas.pandruvada@linux.intel.com, currojerez@riseup.net, javi.merino@kernel.org Subject: Re: [RFC PATCH v3 05/10] sched/topology: Reference the Energy Model of CPUs when available Message-ID: <20180619162042.GT2458@hirez.programming.kicks-ass.net> References: <20180521142505.6522-1-quentin.perret@arm.com> <20180521142505.6522-6-quentin.perret@arm.com> <20180619122632.GS2458@hirez.programming.kicks-ass.net> <20180619132449.GA17720@e108498-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180619132449.GA17720@e108498-lin.cambridge.arm.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 19, 2018 at 02:24:49PM +0100, Quentin Perret wrote: > On Tuesday 19 Jun 2018 at 14:26:32 (+0200), Peter Zijlstra wrote: > > I'm confused by this patch,... what does it do? Why is em_cpu_get() > > (after you fix it) not sufficient? > > Hmm, so maybe the confusing part is that this patch does two things: > 1. it checks all conditions for starting EAS are met > (SD_ASYM_CPUCAPACITY is set, the EM covers all online CPUs, the EM > isn't too complex to be used during wakeup); > 2. it builds a list of frequency domains for the private use of the > scheduler in latency sensitive code paths, 3. and sets the static key > So I guess your question is more about 2. It is nice to have a list of > frequency domains because that makes iteration over frequency domains > in the wake-up path very easy, and efficient (for_each_freq_domain() is > used in find_energy_efficient_cpu() and compute_energy(), patches 07 and > 09/10). > And also, by making the scheduler maintain that list, we can be more > hotplug-aware. If you hotplug out all CPUs of a freq domain, the scheduler > can remove it from its list and have one less element to iterate against. > The idea was tp remove the unused things on hotplug, just like for > sched domains. > > I think that not having that list would mean to play with cpumasks in > find_energy_efficient_cpu() and in compute_energy() to keep track of the > CPUs we have visited and stuff like that. That's doable but probably more > complex, and not more efficient, I think. > > Is the overall idea any clearer ? Right, so I would not do that many things at once. Also be more explicit about what data structure, and why. That said, I think the whole for_each_freq_domain() thing as done is broken. You've completely ignored the arguments to partition_sched_domains(). What happens if you create partitions right along the frequency domains? So you really want an argument to for_each_freq_domain() to indicate who's frequency domains you want to iterate. And then I think it's easiest if you hook into build_sched_domains() instead, because you really want a list per root_domain I suspect (and an empty list if there is but one entry on).