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.3 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 036ECC63777 for ; Tue, 1 Dec 2020 01:06:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DB8F20809 for ; Tue, 1 Dec 2020 01:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729872AbgLABFu (ORCPT ); Mon, 30 Nov 2020 20:05:50 -0500 Received: from mga11.intel.com ([192.55.52.93]:18941 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbgLABFu (ORCPT ); Mon, 30 Nov 2020 20:05:50 -0500 IronPort-SDR: tPvpeZSgCe+NVvNxdXjRROenaHNdhlNMLckC90/aLPKtL7c98dxv85ySzmvwWRmIN1mPj428cg pZfCxBukzooA== X-IronPort-AV: E=McAfee;i="6000,8403,9821"; a="169241197" X-IronPort-AV: E=Sophos;i="5.78,382,1599548400"; d="scan'208";a="169241197" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2020 17:04:08 -0800 IronPort-SDR: /mW1ORI8gJYO/d4eXbn0W7cBdywJ1g3/aMylkXFWWOT8rwUY/M67xXZW7gYpcQXTYKk5LkZWrn H7L87bh90mqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,382,1599548400"; d="scan'208";a="372715290" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.125]) ([10.239.161.125]) by FMSMGA003.fm.intel.com with ESMTP; 30 Nov 2020 17:04:07 -0800 Subject: Re: [PATCH] sched/fair: Clear SMT siblings after determining the core is not idle To: Vincent Guittot , Mel Gorman Cc: Ingo Molnar , Peter Zijlstra , Valentin Schneider , linux-kernel References: <20201130144020.GS3371@techsingularity.net> From: "Li, Aubrey" Message-ID: Date: Tue, 1 Dec 2020 09:04:06 +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/11/30 22:47, Vincent Guittot wrote: > On Mon, 30 Nov 2020 at 15:40, Mel Gorman wrote: >> >> The clearing of SMT siblings from the SIS mask before checking for an idle >> core is a small but unnecessary cost. Defer the clearing of the siblings >> until the scan moves to the next potential target. The cost of this was >> not measured as it is borderline noise but it should be self-evident. > > Good point This is more reasonable, thanks Mel. > >> >> Signed-off-by: Mel Gorman > > Reviewed-by: Vincent Guittot > >> --- >> kernel/sched/fair.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index 0d54d69ba1a5..d9acd55d309b 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -6087,10 +6087,11 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int >> break; >> } >> } >> - cpumask_andnot(cpus, cpus, cpu_smt_mask(core)); >> >> if (idle) >> return core; >> + >> + cpumask_andnot(cpus, cpus, cpu_smt_mask(core)); >> } >> >> /*