Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3055582pxu; Tue, 8 Dec 2020 02:13:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkADHimwCB9xctf0vdd/IpNVCHzHIx6460wid6p3x9Nl6yFhseVbYLZxqeE5h3huY5jkxk X-Received: by 2002:a17:907:c10:: with SMTP id ga16mr12586545ejc.43.1607422406776; Tue, 08 Dec 2020 02:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607422406; cv=none; d=google.com; s=arc-20160816; b=RtVwUITUmgbnpEjtKyzaZpMZkhJbi4DqTD9AeBHYcRmr9TxWokyq3NkMtq/1ZCjTkE QOdJ5iOUN5E5QDT9Fl7QAPfCg7++vAPAB7TERYUzEAZsSqGzSbf6ww+N/RedBgJ+Ajo5 pXOSX3TdPS5A3v8JF6S39tU/h0kL/NWgqpdzPPAI3vBd1mF4CRYIk4y/fTIg7bq+d/zB LKCq1OfBq+pU02jM2xeF2bw7mIH7YK153uDyz07WlzlJkgW3LPaaDDG/gybLGc2OxbGk z8xmdGBd/9VM0U0Sa+gCxGlil+d+RaTcP8qBstfZY3UIPaly9tvarMCx+PaT7Mfi9BaV 491g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=PwW/eJL9ttn5q+8iapCpvA/8XhEGYUBSbOADe/1YELE=; b=kzeSteYRElSU9hfkUoLWjK6TuvUKcxQZjFDDHTs+nWW6OwbPW4PjhCKAEEu6tKyf1v WTsCkXqtCho+RuyJ39V65RYQMon78D7yq/Gwe0tZ2FwAt6WBUM6VnPC73y66Lr5svDw/ f0sOc/mPfMe+pE/09/5Ec8jiaUQW8/6Nznr3fUufGUEYmghoCGcbq0+N36u+kuF42BJ4 fLZ6FvxZUlvR8xXPOs3B3K2TkdRdnD/tvbglJccOoRC558icJ2qURanec9VFtKTfBsyJ lw1gxq0g4X1mzkIIRjqEbB+IVKwvs/7qGN3UB2Wi/FOwTzaBt6efEg0GNdW9SgVDM5rM umXw== 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 q22si8109294ejy.29.2020.12.08.02.13.04; Tue, 08 Dec 2020 02:13:26 -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 S1728996AbgLHKIK (ORCPT + 99 others); Tue, 8 Dec 2020 05:08:10 -0500 Received: from foss.arm.com ([217.140.110.172]:46782 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727122AbgLHKIJ (ORCPT ); Tue, 8 Dec 2020 05:08:09 -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 C3E691FB; Tue, 8 Dec 2020 02:07:23 -0800 (PST) Received: from [192.168.178.2] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 219BA3F68F; Tue, 8 Dec 2020 02:07:20 -0800 (PST) Subject: Re: [PATCH 1/4] sched/fair: Remove SIS_AVG_CPU To: Mel Gorman , LKML Cc: Aubrey Li , Barry Song , Ingo Molnar , Peter Ziljstra , Juri Lelli , Vincent Guittot , Valentin Schneider , Linux-ARM References: <20201207091516.24683-1-mgorman@techsingularity.net> <20201207091516.24683-2-mgorman@techsingularity.net> From: Dietmar Eggemann Message-ID: <25a8c4bd-792b-2851-b10a-c4375eb83dfe@arm.com> Date: Tue, 8 Dec 2020 11:07:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201207091516.24683-2-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/12/2020 10:15, Mel Gorman wrote: > 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 | 3 --- > kernel/sched/features.h | 1 - > 2 files changed, 4 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 98075f9ea9a8..23934dbac635 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -6161,9 +6161,6 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t > avg_idle = this_rq()->avg_idle / 512; > avg_cost = this_sd->avg_scan_cost + 1; > > - if (sched_feat(SIS_AVG_CPU) && avg_idle < avg_cost) > - return -1; > - > if (sched_feat(SIS_PROP)) { > u64 span_avg = sd->span_weight * avg_idle; > if (span_avg > 4*avg_cost) Nitpick: Since now avg_cost and avg_idle are only used w/ SIS_PROP, they could go completely into the SIS_PROP if condition. diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 09f6f0edead4..fce9457cccb9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6121,7 +6121,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; @@ -6130,14 +6129,13 @@ 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)) { + /* + * Due to large variance we need a large fuzz factor; hackbench in + * particularly is sensitive here. + */ + u64 avg_idle = this_rq()->avg_idle / 512; + u64 avg_cost = this_sd->avg_scan_cost + 1; u64 span_avg = sd->span_weight * avg_idle; if (span_avg > 4*avg_cost) nr = div_u64(span_avg, avg_cost); -- 2.17.1