Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3264105pxu; Tue, 8 Dec 2020 07:39:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcfThKatqZy5BQE1NAWgy7LtoBqozL7PIHI1g0yuEksteSluRx1dnQ8C0VZ72TI1D41WW9 X-Received: by 2002:a17:906:f0d0:: with SMTP id dk16mr10295725ejb.144.1607441967139; Tue, 08 Dec 2020 07:39:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607441967; cv=none; d=google.com; s=arc-20160816; b=n5oodgo/biukIRx6LaMvU8TvmWE6PBCT2J+HXBCmjUZ98F2z9U9nSxNnlCRgMkQspf nVju6UkqjwzQtzEA4cqCAgj+NAtxiWts9nG/cczyQ7X/IEpcueAsBHoqODzbTjUsyCv5 wb/OlLg6QDGtNRfgFXV2i8SQFwfCuZFv9LrI9WbK4R6hwP8u9dOl10TN5/koPMniHlcz cVQsmxlWkbmOPtqfx83T1DvV7b3xa47UfLjrBCiF2a4wlG62JfYAxbV4ZzvRzkd9TERB nTErbYXR1B0EzuvAMkre4NnoGhuR0/dvkAGYpJ8AlpGeyO+ypGcV3ztjRzurk4V269YX srOA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=RhR+ichVV3FkmAkfpQJaYLTo2Ye8Od+MEw/b9OxXWEU=; b=baUusxN47IKA+8gvcMsCk91Okf4iUtvEA/m3X5YVO9/MHK4Ab3J9rQaLi5vyjjp2xi FgS1AxelXnn9jgdXyZ0rTtHyHnf9JkrPs7jUMAuXMV16ipBiZX3hSMmovmch71g6CUYT RjspX+A+Qa9w8xOPRifLHALhaCgPGG7Aon8JGRS0hHeucPGZku/Dr0sCyD28D18Z6tWD KIAgrsZLHC892QvyHxxhoP15dGD2Jw4mbRuN9SCB9dWSyELZ6RT9EO/igk8mHeWsDWKZ 2lTA1eqz7inFjcvhVkJmv8jQ6bIRXeYYtug/plzI/Dlvdnaqk3O+erEE2QeluxnEurKP xMZg== 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 b7si9359256edy.561.2020.12.08.07.39.03; Tue, 08 Dec 2020 07:39:27 -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 S1729943AbgLHPgQ (ORCPT + 99 others); Tue, 8 Dec 2020 10:36:16 -0500 Received: from outbound-smtp48.blacknight.com ([46.22.136.219]:35835 "EHLO outbound-smtp48.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729334AbgLHPgP (ORCPT ); Tue, 8 Dec 2020 10:36:15 -0500 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp48.blacknight.com (Postfix) with ESMTPS id E75BEFA902 for ; Tue, 8 Dec 2020 15:35:23 +0000 (GMT) Received: (qmail 10639 invoked from network); 8 Dec 2020 15:35:23 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPA; 8 Dec 2020 15:35:23 -0000 From: Mel Gorman To: Peter Ziljstra , Ingo Molnar , LKML Cc: Aubrey Li , Barry Song , Juri Lelli , Vincent Guittot , Valentin Schneider , Linux-ARM , Mel Gorman Subject: [PATCH 1/4] sched/fair: Remove SIS_AVG_CPU Date: Tue, 8 Dec 2020 15:34:58 +0000 Message-Id: <20201208153501.1467-2-mgorman@techsingularity.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201208153501.1467-1-mgorman@techsingularity.net> References: <20201208153501.1467-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SIS_AVG_CPU was introduced as a means of avoiding a search when the average search cost indicated that the search would likely fail. It was a blunt instrument and disabled by 4c77b18cf8b7 ("sched/fair: Make select_idle_cpu() more aggressive") and later replaced with a proportional search depth by 1ad3aaf3fcd2 ("sched/core: Implement new approach to scale select_idle_cpu()"). While there are corner cases where SIS_AVG_CPU is better, it has now been disabled for almost three years. As the intent of SIS_PROP is to reduce the time complexity of select_idle_cpu(), lets drop SIS_AVG_CPU and focus on SIS_PROP as a throttling mechanism. Signed-off-by: Mel Gorman --- kernel/sched/fair.c | 20 +++++++++----------- kernel/sched/features.h | 1 - 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 98075f9ea9a8..ac7b34e7372b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6145,7 +6145,6 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t { struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask); struct sched_domain *this_sd; - u64 avg_cost, avg_idle; u64 time; int this = smp_processor_id(); int cpu, nr = INT_MAX; @@ -6154,18 +6153,17 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t if (!this_sd) return -1; - /* - * Due to large variance we need a large fuzz factor; hackbench in - * particularly is sensitive here. - */ - avg_idle = this_rq()->avg_idle / 512; - avg_cost = this_sd->avg_scan_cost + 1; + if (sched_feat(SIS_PROP)) { + u64 avg_cost, avg_idle, span_avg; - if (sched_feat(SIS_AVG_CPU) && avg_idle < avg_cost) - return -1; + /* + * Due to large variance we need a large fuzz factor; + * hackbench in particularly is sensitive here. + */ + avg_idle = this_rq()->avg_idle / 512; + avg_cost = this_sd->avg_scan_cost + 1; - if (sched_feat(SIS_PROP)) { - u64 span_avg = sd->span_weight * avg_idle; + span_avg = sd->span_weight * avg_idle; if (span_avg > 4*avg_cost) nr = div_u64(span_avg, avg_cost); else diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 68d369cba9e4..e875eabb6600 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -54,7 +54,6 @@ SCHED_FEAT(TTWU_QUEUE, true) /* * When doing wakeups, attempt to limit superfluous scans of the LLC domain. */ -SCHED_FEAT(SIS_AVG_CPU, false) SCHED_FEAT(SIS_PROP, true) /* -- 2.26.2