Received: by 10.213.65.68 with SMTP id h4csp486640imn; Fri, 23 Mar 2018 08:49:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELtrgIdCaiq37wnxFNc8xmQnGnv3pyqRV7DxInjQJ6SWRKLdblU7txzzTHiVlbqGa/AFfzKc X-Received: by 10.99.2.202 with SMTP id 193mr12085577pgc.117.1521820159768; Fri, 23 Mar 2018 08:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521820159; cv=none; d=google.com; s=arc-20160816; b=Z/wPLS8jwtYU/mWJObOzbyzJkUoSzo5z9I19BerP1GWA6ZohCfDkSqGpqVtKq0evs3 OpcWuEx4EopbZYgEIod/G+6vTFgC918N+24bbMztHzyGe6vR5Od/kwjI0tWMletsyJbD ZJIty1jtOIvnJRHa0DHBy8UCoXWcHYG7wm7eobFuemXVwE7nn/w+6A3LgRwr1KZVcwG4 gWPc4ojCjA8wbDLkCbx91P1Te/e7KhXndsbmCj54wWXIGphBl5/KRAGmUaXAVv/+DNkr ZVpsYcFvFIISuuDOfQuKjLht6VAL5IItN/Ie5exN79+94zCcdhAOPAbhhonnNbfMI+8e f6XA== 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=j+D6Dk11sfbiZ9uIiDasbzzzpYQ/xThEZ5wjHKMqZwE=; b=ZjVUlk0/hgfnAw0Da5jmiDhwDCi8PuO0XhsAt7B/hhEBNfCkshzvB3tgD1Grv2n5S7 DnQ0/DYWzx+FSty8O92Ff9lCscy6w7VpPpBIvOfZyvkJyyD66Oz9lK7GvrGyqQbRi6Aa ouL4rc631uiAuM84UbfCNlhUngYlTav8f7u+CxwLPVb2UIC00J4y4axn7maDqJ9CaWX/ iMzie+knGRz9tOE94gM1/yckphyCAWQQyFMa4+BC0Yzk98GaHm8Mhqgwct0r4e2U5ech MZh3TypGNT6G9uipMf+EJlGpTxwDGh0VIi114M2r4wrKIYJrbO6peZwhfxGyXuL1tQen ylVw== 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 a4-v6si9355283plm.660.2018.03.23.08.49.05; Fri, 23 Mar 2018 08:49:19 -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 S1751985AbeCWPrw (ORCPT + 99 others); Fri, 23 Mar 2018 11:47:52 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52398 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbeCWPrv (ORCPT ); Fri, 23 Mar 2018 11:47:51 -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 8BA231435; Fri, 23 Mar 2018 08:47:50 -0700 (PDT) Received: from e105550-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0FCE43F487; Fri, 23 Mar 2018 08:47:47 -0700 (PDT) Date: Fri, 23 Mar 2018 15:47:45 +0000 From: Morten Rasmussen To: Joel Fernandes Cc: Patrick Bellasi , Dietmar Eggemann , LKML , Peter Zijlstra , Quentin Perret , Thara Gopinath , Linux PM , Chris Redpath , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Viresh Kumar , Todd Kjos Subject: Re: [RFC PATCH 5/6] sched/fair: Select an energy-efficient CPU on task wake-up Message-ID: <20180323154745.GP4589@e105550-lin.cambridge.arm.com> References: <20180320094312.24081-1-dietmar.eggemann@arm.com> <20180320094312.24081-6-dietmar.eggemann@arm.com> <20180321153518.GC13951@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 22, 2018 at 01:10:22PM -0700, Joel Fernandes wrote: > On Wed, Mar 21, 2018 at 8:35 AM, Patrick Bellasi > wrote: > > [...] > > > >> @@ -6555,6 +6613,14 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f > >> break; > >> } > >> > >> + /* > >> + * Energy-aware task placement is performed on the highest > >> + * non-overutilized domain spanning over cpu and prev_cpu. > >> + */ > >> + if (want_energy && !sd_overutilized(tmp) && > >> + cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) > >> + energy_sd = tmp; > >> + > > > > Not entirely sure, but I was trying to understand if we can avoid to > > modify the definition of want_affine (in the previous chunk) and move > > this block before the previous "if (want_affine..." (in mainline but > > not in this chunk), which will became an else, e.g. > > > > if (want_energy && !sd_overutilized(tmp) && > > // ... > > else if (want_energy && !sd_overutilized(tmp) && > > // ... > > > > Isn't that the same? > > > > Maybe there is a code path I'm missing... but otherwise it seems a > > more self contained modification of select_task_rq_fair... > > Just replying to this here Patrick instead of the other thread. > > I think this is the right place for the block from Quentin quoted > above because we want to search for the highest domain that is > !overutilized and look among those for the candidates. So from that > perspective, we can't move the block to the beginning and it seems to > be in the right place. My main concern on the other thread was > different, I was talking about the cases where sd_flag & tmp->flags > don't match. In that case, sd = NULL would trump EAS and I was > wondering if that's the right thing to do... You mean if SD_BALANCE_WAKE isn't set on sched_domains? The current code seems to rely on that flag to be set to work correctly. Otherwise, the loop might bail out on !want_affine and we end up doing the find_energy_efficient_cpu() on the lowest level sched_domain even if there is higher level one which isn't over-utilized. However, SD_BALANCE_WAKE should be set if SD_ASYM_CPUCAPACITY is set so sd == NULL shouldn't be possible? This only holds as long as we only want EAS for asymmetric systems.