Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3282858pxu; Tue, 8 Dec 2020 08:07:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8iuR1H6px3Uy/WD+I8BkU4wXe9SMhA7FW6Us+rPrIzuARoS90rRt+U3dNSgNk/FTHH6/q X-Received: by 2002:aa7:d6d8:: with SMTP id x24mr25681563edr.105.1607443620096; Tue, 08 Dec 2020 08:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607443620; cv=none; d=google.com; s=arc-20160816; b=FT6fPnVLGqoPHMzH2e4upZVsFe6I/P+ahuL1xPbOkHRdk5vPNu+RBaVThRlcCsYFoL NF5tgfxYnKxwPNgls+9Mfr0uIcJHIyUIaH0h+tupSbCi8dmrIeT5XwglZ48WcnLUDW2D aG7shxZHmI0hRWax4Ky5WohxJxBQ0QS1sQRukbTcmE+RWSGH6Ygrs/e/ptuJopNzGdGE 0GT9NFSuitox2Ix1bfDpStR7roCMxhGEGiWiJKtZLUtoOAVvPOY482kvIDpXrKuIxw8Y vxWTXJUv0m+tmjJ/4w8GMmmtD0ks2RFgqtN+Kwgvt49gK459TR4DK+KCM9ET7WK2SEb3 OeNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8LnFBrCqLdwU3AM6hJ1d3uu4vr1BtqBjE7QwQU2+VSQ=; b=ngouqWNJxb7jxY2kJeufCf0SQhnnAcT/enC/v6wjK9hSEWJGY5EOYNO2sal9KEPYJ1 zjOEP9zcpV3WyTsklvuVFzY1QWYWUDSBd0b60xgUrtlr5XDrpWnJuJNWcivG/+WZjkkV cUxgCvHXgUKMjtLANG/F8ac011wTzCVl86BVfq/AvJscY33WD3KQw5wyjSO6nxCvAH9p hq32rzsG2KzqXqNyBOcfDJS6CEvxTDahgKk68F+urXFEw+lSAgjl8rbeJyLGNEL24Mbu pUS54LIMfi67sOot5dFq0snkoQfBf0tx6eo/G/Cg8Hs870jOUHCHtHzYQ/xWr9t/OVH/ nTkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jo2nVsMr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr1si9056834ejc.474.2020.12.08.08.06.35; Tue, 08 Dec 2020 08:07:00 -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; dkim=pass header.i=@linaro.org header.s=google header.b=jo2nVsMr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730169AbgLHQEO (ORCPT + 99 others); Tue, 8 Dec 2020 11:04:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729938AbgLHQEO (ORCPT ); Tue, 8 Dec 2020 11:04:14 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C1A7C0613D6 for ; Tue, 8 Dec 2020 08:03:34 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id s30so24238162lfc.4 for ; Tue, 08 Dec 2020 08:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8LnFBrCqLdwU3AM6hJ1d3uu4vr1BtqBjE7QwQU2+VSQ=; b=jo2nVsMrjTxBSr746SrL3BbieY9fZKGyS76NEd3u2tih/2cAJOcdBXvLZV3kl3gOHF logZojlcxYuY7GPbfOvt+VqM4mpOEIXHTa2SfUMzJ30GFjzR7RrnocuLTbjHNhinoopi t92enLcl5NebsAC1BPQsfHS8RhVN77omNZCefMnFbWubWW3Yhk0SB2FKL3BZrU3u6+wX c2EBqebaGYaV+iord/JI6mXrw6wem6DtzYhjr7Q8LEPPIttIjSiMKEcmDEN/BnRe1a6H kkAWcNh1RjyoMYgVG6dgnt/sYJj3Xeio8Npbcx1R7dUCAJ1qA1JF5hio1Evk+ZG2oMW7 pd1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8LnFBrCqLdwU3AM6hJ1d3uu4vr1BtqBjE7QwQU2+VSQ=; b=K7JX452pOPyhTRSLCcGENczSGZH0Z5yOmengFpJvkZknOEAOJG3vOa4U8iQvlfcuTN W17XjrQN8/0OOXj55S9MZ5L9557Ar3lojtMnVs6jbJFjooaH02fL+irig9y/aPoMS1+V /qoVtUTtrmJ8KvHcKWv/qlIh07Eel/eDW5Bh0/eiZ0NVxCpRMJv2VUFNM7cpxiycq9Yq yFB3y5kceZhZrDktTHYr3FQgh7BUNQKd+DtcNwruJ2BgfPzBI2vAvrWpouPilFWrDGyb qn5yIf+mWlbUGUFUnwuGZdvdrxZv2dQbVopXrzXsWJX5nSn5arw8jv4srOWAIfIByR+h 9/bA== X-Gm-Message-State: AOAM533LhTP5CpWtlfvGCrcLyVgrei6u3ReBoh1e9giD2bu0utZrZ64b lbxmMlwISsJ8j+/O2y0fI1KmdPMDPY+SkOEvCbMgTC+0tugwmg== X-Received: by 2002:a19:be14:: with SMTP id o20mr8130559lff.305.1607443412557; Tue, 08 Dec 2020 08:03:32 -0800 (PST) MIME-Version: 1.0 References: <20201208153501.1467-1-mgorman@techsingularity.net> <20201208153501.1467-3-mgorman@techsingularity.net> In-Reply-To: <20201208153501.1467-3-mgorman@techsingularity.net> From: Vincent Guittot Date: Tue, 8 Dec 2020 17:03:21 +0100 Message-ID: Subject: Re: [PATCH 2/4] sched/fair: Move avg_scan_cost calculations under SIS_PROP To: Mel Gorman Cc: Peter Ziljstra , Ingo Molnar , LKML , Aubrey Li , Barry Song , Juri Lelli , Valentin Schneider , Linux-ARM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) > > + cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); > + > if (sched_feat(SIS_PROP)) { > u64 avg_cost, avg_idle, span_avg; > > @@ -6168,11 +6170,9 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t > nr = div_u64(span_avg, avg_cost); > else > nr = 4; > - } > - > - time = cpu_clock(this); > > - cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); > + time = cpu_clock(this); > + } > > for_each_cpu_wrap(cpu, cpus, target) { > if (!--nr) > @@ -6181,8 +6181,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; > } > -- > 2.26.2 >