From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F10B0C433FE for ; Wed, 9 Dec 2020 05:30:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0C0923B23 for ; Wed, 9 Dec 2020 05:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727236AbgLIFaA (ORCPT ); Wed, 9 Dec 2020 00:30:00 -0500 Received: from mga18.intel.com ([134.134.136.126]:6497 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727208AbgLIFaA (ORCPT ); Wed, 9 Dec 2020 00:30:00 -0500 IronPort-SDR: 0jyBKvK5ScicukHl1VBnESCP8sxiBHOB+iSUkCXNHCQGiikoKvAU8pzCUoCSsetr8xW1s5PbXk IkTxAPC2Rrhw== X-IronPort-AV: E=McAfee;i="6000,8403,9829"; a="161783338" X-IronPort-AV: E=Sophos;i="5.78,404,1599548400"; d="scan'208";a="161783338" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2020 21:28:14 -0800 IronPort-SDR: 6eAQcGkxSGqEwn8BR0S8GYbvj8FHapUmR1uyLN4yvZyLeEoawDJ4mKUBLtWIfxWgY0gvFKMmfU if82vtnqmryA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,404,1599548400"; d="scan'208";a="368047029" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.125]) ([10.239.161.125]) by fmsmga004.fm.intel.com with ESMTP; 08 Dec 2020 21:28:11 -0800 Subject: Re: [PATCH 2/4] sched/fair: Move avg_scan_cost calculations under SIS_PROP To: Vincent Guittot , Mel Gorman Cc: Peter Ziljstra , Ingo Molnar , LKML , Barry Song , Juri Lelli , Valentin Schneider , Linux-ARM References: <20201208153501.1467-1-mgorman@techsingularity.net> <20201208153501.1467-3-mgorman@techsingularity.net> From: "Li, Aubrey" Message-ID: <3255625e-fa92-dc09-9fab-5621122f4af0@linux.intel.com> Date: Wed, 9 Dec 2020 13:28:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: 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 2020/12/9 0:03, 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) > >> >> + 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) nr is the key of this throttling mechanism, need to be placed under sched_feat(SIS_PROP) as well. Thanks, -Aubrey