Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp291028pxf; Thu, 11 Mar 2021 04:07:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3xAChaKNur6HYL+S9qNqKdw3eTmQWoEfJNHRjJxLQsaj7IC5NRb0ELB4UImLu5VVkdS9W X-Received: by 2002:a17:906:c08f:: with SMTP id f15mr2770501ejz.318.1615464438841; Thu, 11 Mar 2021 04:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615464438; cv=none; d=google.com; s=arc-20160816; b=v32WMzdH3CDy6X/Dy8jr/v9O6tEXHWyBeLAq7pTmkOtTw+2RRPdxwjGtgRBevogVY+ zGhwwt8f0uzHBNz02jcVTTnXx5EmC7WY4/phup+ZQza/37u7gozPBnAmZYBdtIFu3Kdt opN0ZOq2HFtohSTQsmIb4gliWxqSLU2qbSZaSwVmA4/gRlj0tHNdCw2i5U7rEXfcnR4r 87SHeaGTyO9y0piauie9rgvmo5BHdvpLH0vRAfDDk+/ev/HSvIqCaiyZuSR+NgiKlzY8 L0o5PPkkGvz8AwndvxIn8++/mfj8PeBn5uDoVzONZ2CkGQcWnM/3aJ2byObwwUyagVhs uNfA== 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=eFavpSUKGNtCjmv8kH7oVhOt88khlUnhPZdSdo8bsPU=; b=zMpXNwSfGJw9BQlR+WLs9Au1XIjc/sFYcxWA2QIQLPaCH6JtSYSUss4HTcGj1W+F2B HcvhmRlve9pkZer6R+3syD0lzkTRnuK6AD0Yf4+eB9ZiA6dec4ZJW0GRm0YnzbGmNXtW 4jk8Jq6WrXQi1WaukKCnAscr6CriWIMwr/wxDJ2W95XhkFxk/5D2lSZ5OewY4M7wIBiX GBbSSFulyHs+KjLScQe5+kHwmTEIZCUz00C3YmR/yCT3GuRsTgFNrgiborw08CmXzCwm 5EleBVF/dFHWgrppHaGPRqK8ITSYInAdAgOoHGg5MPb13Mrys2P1JkRUuzeQf88YgPyg arWA== 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 a10si1563445ejr.227.2021.03.11.04.06.56; Thu, 11 Mar 2021 04:07:18 -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 S232990AbhCKMGA (ORCPT + 99 others); Thu, 11 Mar 2021 07:06:00 -0500 Received: from foss.arm.com ([217.140.110.172]:34006 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233014AbhCKMFf (ORCPT ); Thu, 11 Mar 2021 07:05:35 -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 5D4EB31B; Thu, 11 Mar 2021 04:05:35 -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 C593F3F793; Thu, 11 Mar 2021 04:05:33 -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 v3 0/7] sched/fair: misfit task load-balance tweaks Date: Thu, 11 Mar 2021 12:05:20 +0000 Message-Id: <20210311120527.167870-1-valentin.schneider@arm.com> X-Mailer: git-send-email 2.25.1 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: 13c2235b2b28 ("sched: Remove unnecessary variable from schedule_tail()") 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. The 0day bot reported [3] the first patch causes a ~14% regression on its stress-ng.vm-segv testcase. I ran that testcase on: o Ampere eMAG (arm64, 32 cores) o 2-socket Xeon E5-2690 (x86, 40 cores) and found at worse a -0.3% regression and at best a 2% improvement - I'm getting nowhere near -14%. Revisions ========= v2 -> v3 -------- o Rebased on top of latest tip/sched/core o Added test results vs stress-ng.vm-segv 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 [3]: http://lore.kernel.org/r/20210223023004.GB25487@xsang-OptiPlex-9020 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.25.1