Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2712948pxb; Tue, 19 Jan 2021 04:23:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzrNSBN0GpXXM3v5p8N4+mp6PnsEZm1B8LrRqWdAMw1Ri4RSlhQKlCWOST3A43F/eM/flE X-Received: by 2002:a50:a684:: with SMTP id e4mr3141439edc.148.1611059032843; Tue, 19 Jan 2021 04:23:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611059032; cv=none; d=google.com; s=arc-20160816; b=Pirple3m4tooxVwdulVfPvmdb1kSJABPqfyk5ScJjM4JOXz7JZr+Ed/kwplRcp5R+G DHuxE6nL6muVfRBddm4+a8hniE9ozwvSmO04QmArOavnRjWN/LDs32hA2i1gPq+n7hlW soJqdbbn/4Uf6n909m5BVhmTxf/dlef6vqwwp+sWt2P7E2jfgpFElFiGO0B1SYwNmNAq xLhSUOseO2/gSDd4aNCf7DcqkQcHjmCbmSfbFsCvxvXg2Blg0CviWTAoZp8YudnIQMvE Qyw2mqyXUC/qBsNfhA4NKLD3rE/NKDcbdqrw78oTbH5j6e47IJuHMtCMUWE4/9Ur1m/m 4Y1w== 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=Zm7Sx6R3SIb2i8CJ5E+G6SlnNp97x4T5+ag7g6Xbc80=; b=bj28DOY8cZVQet4xgG1MaQcKjunoY8ylxe30fWiSJ8kRf/xXQ4GSvNgGLxRbSX+SqT 9Lb6bw2ZJfzfshluXq+1pBkNrLfyUtSOzA463dYly9cwzfthzNMbXwhYFcvDL8Dn5ouS dEOtamBjwpsfNffg2qGEKspuydquCq/IbVnLrEnw08JTOfR/YEoLdlwJ8OD16s8rJm9L ehh7lnmUnX1vp20YzsMFg4I4lN0NOKgdotrtiKWRBRgB8+cjHYbs+6s448n1lN9jbErB ZN4LZeygwE7k9YGrtvE80U4LiNX/hD/OZi++sdnlKKCWyM4M3EsRMAYdlANL5IrgtXQ8 6pPw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si5374289eda.444.2021.01.19.04.23.30; Tue, 19 Jan 2021 04:23:52 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391433AbhASLeB (ORCPT + 99 others); Tue, 19 Jan 2021 06:34:01 -0500 Received: from outbound-smtp35.blacknight.com ([46.22.139.218]:36659 "EHLO outbound-smtp35.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389830AbhASLXI (ORCPT ); Tue, 19 Jan 2021 06:23:08 -0500 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp35.blacknight.com (Postfix) with ESMTPS id 03FAB2DCD for ; Tue, 19 Jan 2021 11:22:12 +0000 (GMT) Received: (qmail 4565 invoked from network); 19 Jan 2021 11:22:11 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPA; 19 Jan 2021 11:22:11 -0000 From: Mel Gorman To: Peter Zijlstra , Ingo Molnar Cc: Vincent Guittot , Li Aubrey , Qais Yousef , LKML , Mel Gorman Subject: [PATCH v3 0/5] Scan for an idle sibling in a single pass Date: Tue, 19 Jan 2021 11:22:06 +0000 Message-Id: <20210119112211.3196-1-mgorman@techsingularity.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changelog since v2 o Remove unnecessary parameters o Update nr during scan only when scanning for cpus Changlog since v1 o Move extern declaration to header for coding style o Remove unnecessary parameter from __select_idle_cpu This series of 5 patches reposts three patches from Peter entitled "select_idle_sibling() wreckage". It only scans the runqueues in a single pass when searching for an idle sibling. Two patches from Peter were dropped. The first patch altered how scan depth was calculated. Scan depth deletion is a random number generator with two major limitations. The avg_idle time is based on the time between a CPU going idle and being woken up clamped approximately by 2*sysctl_sched_migration_cost. This is difficult to compare in a sensible fashion to avg_scan_cost. The second issue is that only the avg_scan_cost of scan failures is recorded and it does not decay. This requires deeper surgery that would justify a patch on its own although Peter notes that https://lkml.kernel.org/r/20180530143105.977759909@infradead.org is potentially useful for an alternative avg_idle metric. The second patch dropped converted the idle core scan throttling mechanism to SIS_PROP. While this would unify the throttling of core and CPU scanning, it was not free of regressions and has_idle_cores is a fairly effective throttling mechanism with the caveat that it can have a lot of false positives for workloads like hackbench. Peter's series tried to solve three problems at once, this subset addresses one problem. As with anything select_idle_sibling, it's a mix of wins and losses but won more than it lost across a range of workloads and machines. kernel/sched/core.c | 18 +++-- kernel/sched/fair.c | 161 ++++++++++++++++++++-------------------- kernel/sched/features.h | 1 - kernel/sched/sched.h | 2 + 4 files changed, 95 insertions(+), 87 deletions(-) -- 2.26.2