Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3303903pxu; Tue, 8 Dec 2020 08:35:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtRmDQ8iXT2TDBSmlPkigpNivmQd6o42NecbTH9Ce2yrsQhstpqACZlu3GMZ5YGpo0aYhG X-Received: by 2002:a17:906:7f11:: with SMTP id d17mr24065385ejr.534.1607445320325; Tue, 08 Dec 2020 08:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607445320; cv=none; d=google.com; s=arc-20160816; b=z782UyKuZb+xSmZworEun1/v6PDXYejn+sH1UQZUDQCS+Ppl8rMwniBHanvuvrnZYR 04x9QOUcN4Hye5tM6NaDRcvMiVDoK1SiUswZVKijiia/OK75WFAX/YMAhWl3QhVLpWgI Vg4aPFs+DoOBI8qRuFeFDTXtDcLghJKuobUyWwfMkx7Er6Hckq+G54btfELhYp0o3H05 EAfSfcN78KEPA2R1w2lwJIDEnGoOjKlVh4EjFuNc77NOsc8x3V8ayYbqdNtQAlFXpdDj VTkfn0yHBynjlIsBoO51AfZrKbGZc7g+Px7H+iv/DZ5s4pihirNR80uHM2EW6/pyTmy2 R5kg== 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=bOyiEZpWQNmlobJiJMgcf+uL71yrM7ROOH8F+8HiNhM=; b=04f7CVAlsOx8HgT8MVTaor6Fe+YTKchlrLUmJtv1uzFpYwrcdFc5D18ltOJ/Pj11ez maHmN+VKXTtul3CjQMVUHKJ5TpbtLqkJFrWCcQQ4zh8gct0GSfOkkSHzecH3lI7dWMC5 jcCLMLuIvj+2PBbATuBmB9E+E+AeZ9FE46MqByWXUsDOr2d8XZosO8U/hDgrka2ak/bg 2MjyzJNuIYeGmwXm2xO529knF2BrfWppgcCCFHoaxq68X+V9orBLeqt1fIYGlomr9ZPx VWq1cvtKq/DANBW8VyEivS/HLaNDlKD9pBIsMpvsbI/z0ZhP+xUOhAwDkeYoGI4XwcsC 7cdw== 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 a18si9041701edx.342.2020.12.08.08.34.56; Tue, 08 Dec 2020 08:35:20 -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 S1730312AbgLHQay (ORCPT + 99 others); Tue, 8 Dec 2020 11:30:54 -0500 Received: from outbound-smtp01.blacknight.com ([81.17.249.7]:37330 "EHLO outbound-smtp01.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726080AbgLHQay (ORCPT ); Tue, 8 Dec 2020 11:30:54 -0500 Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp01.blacknight.com (Postfix) with ESMTPS id DF4F3C4A45 for ; Tue, 8 Dec 2020 16:30:01 +0000 (GMT) Received: (qmail 4339 invoked from network); 8 Dec 2020 16:30:01 -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 16:30:01 -0000 Date: Tue, 8 Dec 2020 16:30:00 +0000 From: Mel Gorman To: Vincent Guittot Cc: Peter Ziljstra , Ingo Molnar , LKML , Aubrey Li , Barry Song , Juri Lelli , Valentin Schneider , Linux-ARM Subject: Re: [PATCH 2/4] sched/fair: Move avg_scan_cost calculations under SIS_PROP Message-ID: <20201208163000.GL3371@techsingularity.net> References: <20201208153501.1467-1-mgorman@techsingularity.net> <20201208153501.1467-3-mgorman@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 05:03:21PM +0100, Vincent Guittot wrote: > On Tue, 8 Dec 2020 at 16:35, Mel Gorman wrote: > > > > 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 > > --- > > kernel/sched/fair.c | 14 ++++++++------ > > 1 file changed, 8 insertions(+), 6 deletions(-) > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index ac7b34e7372b..5c41875aec23 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -6153,6 +6153,8 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t > > if (!this_sd) > > return -1; > > Just noticed while reviewing the patch that the above related to > this_sd can also go under sched_feat(SIS_PROP) > Technically yes but I also decided against it. It's a functional difference depending on whether SIS_PROP is set in the highly unlikely case that this_sd == NULL. I was also thinking in terms of what happens if SIS_PROP was disabled and enabled while a search is in progress even if it's very unlikely. In that case, this_sd would be uninitialised. That might be impossible in practice depending on how static branching is implemented but I don't think we should rely on the internals of jump labels and play it safe. I can move it in if you feel strongly about it but I think the disable/enable race is enough of a concern to leave it alone. -- Mel Gorman SUSE Labs