Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4124867pxu; Mon, 30 Nov 2020 18:42:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJww9GMZ12ZAheq9wyFIJ0LBfASU1kz/p7zHeAQsiB5z0/zvh86ffq5p/bFlamRdQahRajFO X-Received: by 2002:a17:906:7ac7:: with SMTP id k7mr942847ejo.454.1606790524754; Mon, 30 Nov 2020 18:42:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606790524; cv=none; d=google.com; s=arc-20160816; b=EGmV31Pfzqg1gNikc8BGqOCVZnhO3eo9svH9T5wIzRl+E3EH9WO8aiYieFXMDF7S6N MxaxZDUsHi0epKerdmbVWGfF3f5zFJ84YtStlWg+Hn9DTt2f5r3ZkmyPzTIdWbS4750b pNxrOxIyUZ5KszuLMwjsWIFbg9Y/bvl1KSGPvIzh3rdky117hJ28PFfpPTyD3X7fN27x NuNaLJui0KW//aobfTlm5UflYbfOdrPRI87rnPmboZgVrhV9jPgBPjFx0uSw/iFDPe/C KWxravh7bOOelMkU6I5lJLcQSa6X1+v4FzjOHAcRzWwzjmh3V0Xljpa0qb13mdxO+J5a hgGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=QKJvy/FEtlmVMN0g5gUj5BX7nUtMMiCQEzwVzVE6lCY=; b=AWJlCcIK3YTjXc1Jy3CsPdS9ZOjYWDzmClV4dSZrqBLKCkS2dGNr5YfMwhTdHU+0Gv H5IL/SjZ6jQbumGfmuSY/h2AyCR83SjjS2ioc7QUGlFmlgjq7nNP4HTE0KQwee9LdXC9 w1OciV/FMpQ5JRyfHDfxZfxkybAXrYwjKKUFgmWZ4mJPEQ3eFUnzlhyYrrVMynpeyouV +40CB+TcImP+u9Lm7vs3dhyxhNBnEb/Nd1S1/71nKtcJcwemaExrmW2Ig6QeOvMKWAAo 7tXH974XlY7LfSGqiYYqY4GWxwBaVe7AIl36Y0OGhBMuSGbjTsIvbCpHz7XsjNc8Q1+r 20+w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o3si73162ejn.637.2020.11.30.18.41.42; Mon, 30 Nov 2020 18:42:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729481AbgLABFu (ORCPT + 99 others); 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)); >> } >> >> /*