Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2231371pxb; Fri, 5 Feb 2021 12:13:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkmHUkEM5K9mmZkOvIzCgPzzS+fP0oNs0Jo4tFVDkMfRjkua9keWbIw1dDPvjJd8qaBNQq X-Received: by 2002:a05:6402:50ce:: with SMTP id h14mr5207116edb.283.1612556001396; Fri, 05 Feb 2021 12:13:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612556001; cv=none; d=google.com; s=arc-20160816; b=ukBqf4ytLMYcgGHBsTEoWyNgdPKRtOCE11lr2heQF5ISJJQxCLpIOlPkTH64iybWXv piWLluwlTYSlSgqzo2MZSkw8rAiHzlXSQo+42SpEwgzYB79ndejKUznnTL+uwSS7rwYX Uuba7mgz9ME4Jk9mJjbu5YAF/9uhnQE1v3sEW3H2JHISzPI1G4dLsB5iuJ4/urTue+VA O7tpb7UW6bYyAj0PS2ue6pMkPE5cqrpOzh9EpPogy/PjdNtIhB8S01kWDsEfKa0JHtbB uBU7YOH+Ui/w52S0NE5ew7YlrcC0sz6cyeEmrHoV82xAEVd4zydRFEyz3Rfb7XDuTYG5 LAGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from; bh=vz15fzUiXIGPkqQqsnDXu31xsg6Jwsc8+fJcENLlyXo=; b=PZKiA3/AQklvPp+fcZLldG3M0aMYxmli7ngIxg/AgMb9wT/UBj2gWQpYPuUpNrD805 1CVzrzefIFATgjhkPszEtZusEZly27k2pnC2cu9cKQCQxLmfZSHpFAd+vV+5W3S8vOjS OcKdEuHKkCepLgOcU+K0D0KMN5LxOzh70Ww6XNBxzkI4BT1H9pyr/uGW0qiRQbiBPCNi 9DbPEpY7+jk6KrJu0rwULiMz4eg30V/6LJmLYcV1ERqntj2pbKJFVyH3sJLPdvStOwzn Yqi0zO+P6VMO8YcuNmbn0B/xIRYaZT0zBkr/OpZEIcX4osc/G78k3sCEjASvitlL/YsI jdgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si6099768eju.458.2021.02.05.12.12.55; Fri, 05 Feb 2021 12:13:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233603AbhBES1H (ORCPT + 99 others); Fri, 5 Feb 2021 13:27:07 -0500 Received: from foss.arm.com ([217.140.110.172]:41352 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbhBESZp (ORCPT ); Fri, 5 Feb 2021 13:25:45 -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 BD627ED1; Fri, 5 Feb 2021 12:07:14 -0800 (PST) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6AA4C3F718; Fri, 5 Feb 2021 12:07:13 -0800 (PST) From: Valentin Schneider To: Vincent Guittot Cc: linux-kernel , Peter Zijlstra , Ingo Molnar , Dietmar Eggemann , Morten Rasmussen , Qais Yousef , Quentin Perret , Pavan Kondeti , Rik van Riel Subject: Re: [PATCH 3/8] sched/fair: Tweak misfit-related capacity checks In-Reply-To: References: <20210128183141.28097-1-valentin.schneider@arm.com> <20210128183141.28097-4-valentin.schneider@arm.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Fri, 05 Feb 2021 20:07:08 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02/21 18:17, Vincent Guittot wrote: > On Fri, 5 Feb 2021 at 18:00, Valentin Schneider >> >> @@ -8253,7 +8260,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) >> >> static inline int check_misfit_status(struct rq *rq, struct sched_domain *sd) >> >> { >> >> return rq->misfit_task_load && >> >> - (rq->cpu_capacity_orig < rq->rd->max_cpu_capacity || >> >> + (capacity_greater(rq->rd->max_cpu_capacity, rq->cpu_capacity_orig) || >> > >> > Why do you add a margin here whereas there was no margin before ? >> > >> >> Comparing capacities without any sort of filter can lead to ping-ponging >> tasks around (capacity values very easily fluctuate by +/- 1, if not more). > > max_cpu_capacity reflects the max of the cpu_capacity_orig values > don't aim to change and can be considered as static values. > It would be better to fix this rounding problem (if any) in > topology_get_cpu_scale instead of computing a margin every time it's > used > That's embarrassing, I was convinced we had something updating rd->max_cpu_capacity with actual rq->capacity values... But as you point out that's absolutely not the case, it's all based on rq->capacity_orig, which completely invalidates patch 5/8. Welp. Perhaps I can still keep 5/8 with something like if (!rq->misfit_task_load) return false; do { if (capacity_greater(group->sgc->max_capacity, rq->cpu_capacity)) return true; group = group->next; } while (group != sd->groups); return false; This works somewhat well for big.LITTLE, but for DynamIQ systems under a single L3 this ends up iterating over all the CPUs :/