Received: by 10.192.165.156 with SMTP id m28csp949194imm; Wed, 18 Apr 2018 00:59:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/V6ufWHtDZwEXDQ6u1B4X4iEOW0zly9czxBPfSAO7qUisKDU9AWMLEps7Mkm8LiLhvno+V X-Received: by 10.98.107.138 with SMTP id g132mr1027149pfc.163.1524038396041; Wed, 18 Apr 2018 00:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524038396; cv=none; d=google.com; s=arc-20160816; b=dUoGJaUuZfd6rl/CQ14ohMZbtjPjEAlqQh3NfZKV/uGqLsLf/V8IawyAg9qMgRCd93 KeKbfcIHkJzCulSyasVc7REy6cpF9NxvtDc3Veqo8vO+v7ZOsj3i2+yfcBcA4OSN0cQl CjvI45eknYSWnQRFu3Zjnrl1noJy207cRAQFzX0w/9NhMgBgvyKMXPy33QiiNcQwbq3h dLYkUMCOWU9H9KVqG7XhmsNxynykjt1EFb5KLmaGfPd/BzmzHokSnqaZ3IH2eua5Z0y8 Z3Rxcr21oSV/JJHdHenPkC8xSrVfcqvCUN4AAsDDqIIfPvl3ymB2kZLnGtmmYOamlZ0d p86g== 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=AzJYLpdwWDQfETFLwjc+8kX7Y1M60H8cgRqBGsfwR50=; b=Flnw6292gpRE0xYsJQiG5P4EXJFWfhkYhJJiKA312iSgPM0VJNvRu6fdJvzV1I1g7M yrJr1AerCNBAwDR1LD/DGlC1MJjkoNqA8mwaDWKAek9wRNYX/wdeaXGPdJJccKHCT8qi AMqKp9utczwfdJ0Eeo9Cb1Bpn9nSKHW4NlI7KbwmVU66n9HdL9RuwIAqiGk7b6+kyi8c gLkBC9G9gQTtw9Z0ZhRFhtwqKb3oWaD4+PE5RlsnTCdxBXD3R1pNR1W5Br61mKLcHp41 lssTsJOCakDsmRRivIGA2BrJdMKB9WvXRSYKAnbB4oqIK9Qkb2ni7Q2CdRaZmZeqEAaA wInQ== 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 131si679917pfa.246.2018.04.18.00.59.41; Wed, 18 Apr 2018 00:59:55 -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 S1753006AbeDRH5x (ORCPT + 99 others); Wed, 18 Apr 2018 03:57:53 -0400 Received: from foss.arm.com ([217.140.101.70]:51258 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752786AbeDRH5w (ORCPT ); Wed, 18 Apr 2018 03:57:52 -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 064FF1435; Wed, 18 Apr 2018 00:57:52 -0700 (PDT) Received: from e108498-lin.cambridge.arm.com (e108498-lin.cambridge.arm.com [10.1.210.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E50F93F25D; Wed, 18 Apr 2018 00:57:48 -0700 (PDT) Date: Wed, 18 Apr 2018 08:57:43 +0100 From: Quentin Perret To: Leo Yan Cc: Dietmar Eggemann , linux-kernel@vger.kernel.org, Peter Zijlstra , 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 5/6] sched/fair: Select an energy-efficient CPU on task wake-up Message-ID: <20180418075742.GA3943@e108498-lin.cambridge.arm.com> References: <20180406153607.17815-1-dietmar.eggemann@arm.com> <20180406153607.17815-6-dietmar.eggemann@arm.com> <20180417153944.GD18509@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180417153944.GD18509@leoy-ThinkPad-X240s> 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 Hi Leo, On Tuesday 17 Apr 2018 at 23:39:44 (+0800), Leo Yan wrote: > > + for_each_freq_domain(fd) { > > + unsigned long spare_cap, max_spare_cap = 0; > > + int max_spare_cap_cpu = -1; > > + unsigned long util; > > + > > + /* Find the CPU with the max spare cap in the freq. dom. */ > > + for_each_cpu_and(cpu, freq_domain_span(fd), sched_domain_span(sd)) { > > + if (!cpumask_test_cpu(cpu, &p->cpus_allowed)) > > + continue; > > + > > + if (cpu == prev_cpu) > > + continue; > > + > > + util = cpu_util_wake(cpu, p); > > + cpu_cap = capacity_of(cpu); > > + if (!util_fits_capacity(util + task_util, cpu_cap)) > > + continue; > > + > > + spare_cap = cpu_cap - util; > > + if (spare_cap > max_spare_cap) { > > + max_spare_cap = spare_cap; > > + max_spare_cap_cpu = cpu; > > + } > > + } > > If have two clusters, and if firstly iterate the big cluster, then > max_spare_cap is a big value for big cluster and later LITTLE cluster > has no chance to have higher value for spare_cap. For this case, the > LITTLE CPU will be skipped for energy computation? max_spare_cap is reset to 0 at the top of the for_each_freq_domain() loop above so that shouldn't happen. Thanks, Quentin