Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3178081pxu; Tue, 8 Dec 2020 05:41:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDbir/3qraffNVYctQYpAgU9JzBm6oDgZxGe3mjlorvp830svZdDj7Y4woH5mS0chWNyWN X-Received: by 2002:a17:906:d19b:: with SMTP id c27mr23749809ejz.234.1607434872216; Tue, 08 Dec 2020 05:41:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607434872; cv=none; d=google.com; s=arc-20160816; b=UGFycge+NR/MCAs2EzwCQDilfmpowayNbrQG7vtMbOt6N2CWB2cr0ypQndGDtGVny0 h6WLkkJM9bxzlZgWrLHGkTseQiIuRc6RYFOLlVdtszNJ8ZRozCvOXdsmmuH1A6iUXsHJ zC2M0XULc6blsXE/aITlcjlFT0E60PpPyI5rTiJdPYQs3MpSdVbFh/p4fL4GLiDxET9r 8t/AXAZ/ZYik3qQkmYCFa0YPqlNlMlVidWNvlC3dZSON0gF/+31Qmmfc6cPsuINdpGdd Y2mJwFUrItlq+SY5IZB9DxeS+DQm22Exzj9uDngYWk7ekzAP46AbIMrMyUzM5mz6GK6e PXAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cNrxhdy35e7lxjesTXDPUEfGEA/G9S6agFRzInLbL1g=; b=ISBE9dRzYVRqkvgkDBOSqWPGb7X0HuN2Gxp0nBfXwt68f7yo0YaPwZBdYqDPHCtFaO +4A9NTdtiPAFQiMywSuliqu9XTdLU74uCgj97DBvlq9fscaNuRI9TitWZ3G13jzgPrld M/w5BhJ6NyojlD/kja7ewaJYGZJbRdQDyhjPn+kUMon6GCOv0uhGky8BPs2/TbK/Jgiq 805ROEt2MoLLXJl8q/2jVRekHOGN75Olrzs7bFj6jQkOi09YKizX5jaKlahjN4/xI0d6 BX4MfOwSad5waqN0T5qEy1AZdmgQxbz6jp8BAWodbvvHZkqZnEWShkBuqggqAZqVISzy TYOA== 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 t14si10537098edy.67.2020.12.08.05.40.46; Tue, 08 Dec 2020 05:41:12 -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 S1729428AbgLHNho (ORCPT + 99 others); Tue, 8 Dec 2020 08:37:44 -0500 Received: from outbound-smtp22.blacknight.com ([81.17.249.190]:47662 "EHLO outbound-smtp22.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729020AbgLHNho (ORCPT ); Tue, 8 Dec 2020 08:37:44 -0500 Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp22.blacknight.com (Postfix) with ESMTPS id 4F803BABD7 for ; Tue, 8 Dec 2020 13:36:52 +0000 (GMT) Received: (qmail 32152 invoked from network); 8 Dec 2020 13:36:52 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 8 Dec 2020 13:36:52 -0000 Date: Tue, 8 Dec 2020 13:36:50 +0000 From: Mel Gorman To: Vincent Guittot Cc: Dietmar Eggemann , LKML , Aubrey Li , Barry Song , Ingo Molnar , Peter Ziljstra , Juri Lelli , Valentin Schneider , Linux-ARM Subject: Re: [PATCH 1/4] sched/fair: Remove SIS_AVG_CPU Message-ID: <20201208133650.GI3371@techsingularity.net> References: <20201207091516.24683-1-mgorman@techsingularity.net> <20201207091516.24683-2-mgorman@techsingularity.net> <25a8c4bd-792b-2851-b10a-c4375eb83dfe@arm.com> <20201208105900.GG3371@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 08, 2020 at 02:24:32PM +0100, Vincent Guittot wrote: > > > Nitpick: > > > > > > Since now avg_cost and avg_idle are only used w/ SIS_PROP, they could go > > > completely into the SIS_PROP if condition. > > > > > > > Yeah, I can do that. In the initial prototype, that happened in a > > separate patch that split out SIS_PROP into a helper function and I > > never merged it back. It's a trivial change. > > while doing this, should you also put the update of > this_sd->avg_scan_cost under the SIS_PROP feature ? > It's outside the scope of the series but why not. This? --8<-- sched/fair: Move avg_scan_cost calculations under SIS_PROP As noted by Vincent Guittot, avg_scan_costs are calculated for SIS_PROP even if SIS_PROP is disabled. Move the time calculations under a SIS_PROP check and while we are at it, exclude the cost of initialising the CPU mask from the average scan cost. Signed-off-by: Mel Gorman diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 19ca0265f8aa..0fee53b1aae4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6176,10 +6176,10 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t nr = 4; } - time = cpu_clock(this); - cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); + if (sched_feat(SIS_PROP)) + time = cpu_clock(this); for_each_cpu_wrap(cpu, cpus, target) { if (!--nr) return -1; @@ -6187,8 +6187,10 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t break; } - time = cpu_clock(this) - time; - update_avg(&this_sd->avg_scan_cost, time); + if (sched_feat(SIS_PROP)) { + time = cpu_clock(this) - time; + update_avg(&this_sd->avg_scan_cost, time); + } return cpu; }