Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5179728imm; Tue, 19 Jun 2018 06:26:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLT50YFssmfDhLr4+HoLcfq0U+CQZSSoOPYYTmqRB81ojXMbLnCxVP0KpXVMmDHlgm97H7Z X-Received: by 2002:a62:3dca:: with SMTP id x71-v6mr18167584pfj.134.1529414781137; Tue, 19 Jun 2018 06:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529414781; cv=none; d=google.com; s=arc-20160816; b=nRDIZs9xxYaJf0wAWgL5GdiZ9XyCdJ3P3EQxPCgOvnR9oQeBxxTKNIK8XfXi8wTLQl s8dt8zfzNWn9f2wrF0BfMN4M8KN51wgDdchIdGgJw1qS9uRS4fEkEGyeHQnquDouc/3j n6ccfKAlTE4jNxPBatpI2krejhn8X/YZOEqCjl+oULdkt4xKO/etsDy1mZWFPKP6VxJj K4D2oOve4GFb65GBMY6/tdYYCqMBJ+DzePTJkSYcyZw/mGXM08QPXM/bE585myDVnpEX yH6DmSVqf8esP/88pm5p9BCFikKOQ0f7HxOGDnzIz93AnCeGfYg/DS7AkWdT+OgIrQ92 XEcQ== 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:arc-authentication-results; bh=ieurMa2dC9GLw+lB9rSfpJMpYXhlNRWzaRtN1Av7hpg=; b=Cry+wKxY+k0PXQ3VS8SDpkSJmPJcfD4ZNDLbwmfwYosgc+0NKfyC0MNh1XIgo7S9Xe uYsCJmhZSTC6DL7PbYmkCfJ5HERN3qpFK03EDEFhy3YkfT5yLuHez+Rus1yC4/O101Bg mNo9UEwP9oejsIJIE19DMux8BGauCF6nzySAJnhMnLNjDFtVB8iKyHvkcqly3RYTrqnM q4dy2G2rk/WKHVr3iB0jzhMS1n2N4DQPbjUA0pWft8SCR4XuCtq1OQySSSJdtytT4nCU h0JkRY3SPtbE13nHWd7vW5TEcq4t/mFoH+NGmggV/+DmzwQGvibaF7xWUf0Y4bh7ubAK hekw== ARC-Authentication-Results: i=1; mx.google.com; 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 x23-v6si17112634pfe.318.2018.06.19.06.26.07; Tue, 19 Jun 2018 06:26:21 -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; 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 S937860AbeFSNY5 (ORCPT + 99 others); Tue, 19 Jun 2018 09:24:57 -0400 Received: from foss.arm.com ([217.140.101.70]:50154 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937149AbeFSNYz (ORCPT ); Tue, 19 Jun 2018 09:24:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 09E9480D; Tue, 19 Jun 2018 06:24:55 -0700 (PDT) Received: from e108498-lin.cambridge.arm.com (e108498-lin.cambridge.arm.com [10.1.211.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 122DC3F25D; Tue, 19 Jun 2018 06:24:50 -0700 (PDT) Date: Tue, 19 Jun 2018 14:24:49 +0100 From: Quentin Perret To: Peter Zijlstra 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: <20180619132449.GA17720@e108498-lin.cambridge.arm.com> References: <20180521142505.6522-1-quentin.perret@arm.com> <20180521142505.6522-6-quentin.perret@arm.com> <20180619122632.GS2458@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180619122632.GS2458@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 19 Jun 2018 at 14:26:32 (+0200), Peter Zijlstra wrote: > On Mon, May 21, 2018 at 03:25:00PM +0100, Quentin Perret wrote: > > In order to use EAS, the task scheduler has to know about the Energy > > Model (EM) of the platform. This commit extends the scheduler topology > > code to take references on the frequency domains objects of the EM > > framework for all online CPUs. Hence, the availability of the EM for > > those CPUs is guaranteed to the scheduler at runtime without further > > checks in latency sensitive code paths (i.e. task wake-up). > > 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, 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 ? Thanks, Quentin