Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp8000077pxb; Fri, 19 Feb 2021 05:05:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvah6l6HdbyDu9LlUlxGfFad1ENVIC17nS0CiXHZM1oP8VjHnArbLNHCpKlzcwCTXMTN8l X-Received: by 2002:a17:906:753:: with SMTP id z19mr8512188ejb.15.1613739910761; Fri, 19 Feb 2021 05:05:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613739910; cv=none; d=google.com; s=arc-20160816; b=MGob3W0WeoGIcRc+XEmpbnjX1pDCid3SmQnHcHdtXDxrqG6WEUPpuf1P7S04FbSshi yH1xi+L5oMY+5jreYuhuHEWJME0a8Z/ZH3KK7w+xzHPA3hwVaNHXroKGAJ7I+knKOcp3 0Tc9goxYNKatXd60801paKtn/ENvIPBe41LcNmvL/qNqDwTxNcKUWeXP61L4IuLpMET7 tiMYOl2hB+5NzY1fQY16/K1SiixacY1TYBXUkyVnC9srksD1vqMyeB4ReYnANPn3qwxX CWsK1yEyecmSANzA4NahBsIxUoI0NztuWMfCwO0Dg5JcAz2m6KIKH9uEEsfjMFW63DU/ SDcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qOxLLSeKeqVL9f83nnNIjXabq294DwSWCRa9xSCyv5s=; b=cbaCijpfSzTenk8P9+Oc6YYPf6BZshqY7OJoHafQCuEhK0b2U+STeaGDFQn3aJiULT QMJyne4NraRbzRyPcqvJB8RuQ7YvC6YdUx9Rfc3kxkGpDJIAuRMfhMvVWa9yhtILMKBX UdU3er8tAqGm5T8S8x396BM/XQWAoVrhpaWbAzn1dXBv2tWlnArDLRh0t+w6vHcyBVn1 K0zoeWZJKD1VH0Bcw81Al+IW4pOnCMBIbr20ECDBTR3ma1A2Dd6BY49YtkqIxl9PRPSy //k6H2Wt6wP4Sw0wk4uCc5ZCJx3apHK6YJjLe+YKXVXUN9KE47qxJVsw7BQ0J+6z+I74 5ihA== 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 e18si6241792edz.446.2021.02.19.05.04.44; Fri, 19 Feb 2021 05:05:10 -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 S230014AbhBSNDR (ORCPT + 99 others); Fri, 19 Feb 2021 08:03:17 -0500 Received: from foss.arm.com ([217.140.110.172]:35824 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbhBSNDQ (ORCPT ); Fri, 19 Feb 2021 08:03:16 -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 5B81C1FB; Fri, 19 Feb 2021 05:02:30 -0800 (PST) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BEA863F73B; Fri, 19 Feb 2021 05:02:28 -0800 (PST) From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Qais Yousef , Quentin Perret , Pavan Kondeti , Rik van Riel , Lingutla Chandrasekhar Subject: [PATCH v2 0/7] sched/fair: misfit task load-balance tweaks Date: Fri, 19 Feb 2021 12:59:56 +0000 Message-Id: <20210219130003.2890-1-valentin.schneider@arm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi folks, Here is this year's series of misfit changes. On the menu: o Patch 1 prevents pcpu kworkers from causing group_imbalanced o Patch 2 is an independent active balance cleanup o Patch 3 adds some more sched_asym_cpucapacity static branches o Patch 4 introduces yet another margin for capacity to capacity comparisons o Patches 5-6 build on top of patch 4 and change capacity comparisons throughout misfit load balancing o Patch 7 aligns running and non-running misfit task cache hotness considerations IMO the somewhat controversial bit is patch 4, because it attempts to solve margin issues by... Adding another margin. This does solve issues on existing platforms (e.g. Pixel4), but we'll be back to square one the day some "clever" folks spin a platform with two different CPU capacities less than 5% apart. This is based on top of today's tip/sched/core at: c5e6fc08feb2 ("sched,x86: Allow !PREEMPT_DYNAMIC") Testing ======= I ran my usual [1] misfit tests on o TC2 o Juno o HiKey960 o Dragonboard845C o RB5 RB5 has a similar topology to Pixel4 and highlights the problem of having two different CPU capacity values above 819 (in this case 871 and 1024): without these patches, CPU hogs (i.e. misfit tasks) running on the "medium" CPUs will never be upmigrated to a "big" via misfit balance. Revisions ========= v1 -> v2 -------- o Collected Reviewed-by o Minor comment and code cleanups o Consolidated static key vs SD flag explanation (Dietmar) Note to Vincent: I didn't measure the impact of adding said static key to load_balance(); I do however believe it is a low hanging fruit. The wrapper keeps things neat and tidy, and is also helpful for documenting the intricacies of the static key status vs the presence of the SD flag in a CPU's sched_domain hierarchy. o Removed v1 patch 4 - root_domain.max_cpu_capacity is absolutely not what I had convinced myself it was. o Squashed capacity margin usage with removal of group_smaller_{min, max}_capacity() (Vincent) o Replaced v1 patch 7 with Lingutla's can_migrate_task() patch [2] o Rewrote task_hot() modification changelog Links ===== [1]: https://lisa-linux-integrated-system-analysis.readthedocs.io/en/master/kernel_tests.html#lisa.tests.scheduler.misfit.StaggeredFinishes [2]: http://lore.kernel.org/r/20210217120854.1280-1-clingutla@codeaurora.org Cheers, Valentin Lingutla Chandrasekhar (1): sched/fair: Ignore percpu threads for imbalance pulls Valentin Schneider (6): sched/fair: Clean up active balance nr_balance_failed trickery sched/fair: Add more sched_asym_cpucapacity static branch checks sched/fair: Introduce a CPU capacity comparison helper sched/fair: Employ capacity_greater() throughout load_balance() sched/fair: Filter out locally-unsolvable misfit imbalances sched/fair: Relax task_hot() for misfit tasks kernel/sched/fair.c | 128 ++++++++++++++++++++++++------------------- kernel/sched/sched.h | 33 +++++++++++ 2 files changed, 105 insertions(+), 56 deletions(-) -- 2.27.0