Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp479999ybl; Wed, 29 Jan 2020 04:12:11 -0800 (PST) X-Google-Smtp-Source: APXvYqz2nF02RRJb942Zv9TTXE3x3a4id3S+62nWsMSrlwAS1SpOZubtgMZ0jn9L0i19AA5eH9Vw X-Received: by 2002:aca:2118:: with SMTP id 24mr6193345oiz.28.1580299930971; Wed, 29 Jan 2020 04:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580299930; cv=none; d=google.com; s=arc-20160816; b=SF3udJqnSXvtLJlQJhURFMoJVg6cADYCy/LM/a5LQd20f/YpLrSK7OfgvWutEa7+wr 9UYfW/vm8ORmTQkoF4HhVtIJ/oqvNM54bEZJvkHxGFGtwmzwNVE/QdtYBzj+AKS8lU0Q +QbuaNY0HxRnFSN7OWGfscCeKQu68VOzDgsAMOdGSM1MqGZSm5IhMQeG8GfePsquzj5h k++mTKBIlzk253o8iphVIXzZdrLIOJijSS1GSNH/O+/Py/a4vi06l+roC+NA2NNE7iD9 cQPHBAPlghmW1K4Ni+DaTQLYxSlFYdTTonHQBRLq+o+OUlai6b4CbQqI8uGr5S/Bi3DN hnHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ks3FOQrYP94zV4Wd5+q1Pkt543uqied8BGeiOPXI3/0=; b=zdhvQasDF37yYp5bQBExDaVggwZpBpj0myn+hiOVhduT3SUuPa/Kah+4nsNF040UO0 jWTEJGYSwwwDAPSlE80AEJo1dCouumB+6HuT13xRbHSfPVnpYA6sNU2gMWQ68rrLqyX3 T0zvavwlGSbjwNCgvb0BXXj969lZEZ+EXF7Po9sKKfH9dqx+6qHILfcuFWbRJfyH1bq1 Z2dpUcLLlm0LxdSlyT+uXg2/jYmzgO43jqyAE84RPx5qUF/LEpy5IZ7WfqW0f+1gPZgb +LP+f6kg2sFppzRcxG1c+5VN6zF8Bmtou06E3iRfI/GpMGRBP49esBBzbk/roPsfMXVX rzJw== 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 w7si1130822oie.196.2020.01.29.04.11.58; Wed, 29 Jan 2020 04:12:10 -0800 (PST) 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 S1726604AbgA2MK5 (ORCPT + 99 others); Wed, 29 Jan 2020 07:10:57 -0500 Received: from foss.arm.com ([217.140.110.172]:40314 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726271AbgA2MK5 (ORCPT ); Wed, 29 Jan 2020 07:10:57 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C50041FB; Wed, 29 Jan 2020 04:10:56 -0800 (PST) Received: from [10.0.2.15] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B747E3F67D; Wed, 29 Jan 2020 04:10:55 -0800 (PST) Subject: Re: [PATCH v3 1/3] sched/fair: Add asymmetric CPU capacity wakeup scan To: Dietmar Eggemann , linux-kernel@vger.kernel.org Cc: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, morten.rasmussen@arm.com, qperret@google.com, adharmap@codeaurora.org References: <20200126200934.18712-1-valentin.schneider@arm.com> <20200126200934.18712-2-valentin.schneider@arm.com> From: Valentin Schneider Message-ID: <40bfa77b-b695-5f53-848a-b72b67b33d69@arm.com> Date: Wed, 29 Jan 2020 12:10:55 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/01/2020 11:04, Dietmar Eggemann wrote: >> + /* >> + * It would be silly to keep looping when we've found a CPU >> + * of highest available capacity. Just check that it's not been >> + * too pressured lately. >> + */ >> + if (rq->cpu_capacity_orig == READ_ONCE(rq->rd->max_cpu_capacity) && > > There is a similar check in check_misfit_status(). Common helper function? Mright, and check_misfit_status() is missing the READ_ONCE(). That said... > >> + !check_cpu_capacity(rq, sd)) >> + return cpu; > > I wonder how this special treatment of a big CPU behaves in (LITTLE, > medium, big) system like Pixel4 (Snapdragon 855): > > flame:/ $ cat /sys/devices/system/cpu/cpu*/cpu_capacity > > 261 > 261 > 261 > 261 > 871 > 871 > 871 > 1024 > > Or on legacy systems where the sd->imbalance_pct is 25% instead of 17%? > ... This is a very valid point. When I wrote this bit I had the good old big.LITTLE split in mind where there are big differences between the capacity values. As you point out, that's not so true with DynamIQ systems sporting > 2 capacity values. The issue here is that we could bail early picking a (slightly) pressured big (1024 capacity_orig) when there was a non-pressured idle medium (871 capacity orig). It's borderline in this example - the threshold for a big to be seen as pressured by check_cpu_capacity(), assuming a flat topology with just an MC domain, is ~ 875. If we have e.g. mediums at 900 and bigs at 1024, this logic is broken. So this is pretty much a case of my trying to be too clever for my own good, I'll remove that "fastpath" in v4. Thanks for pointing it out!