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=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 0F61DC63777 for ; Thu, 3 Dec 2020 09:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA83720709 for ; Thu, 3 Dec 2020 09:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730108AbgLCJOE (ORCPT ); Thu, 3 Dec 2020 04:14:04 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:39472 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728034AbgLCJOC (ORCPT ); Thu, 3 Dec 2020 04:14:02 -0500 Date: Thu, 03 Dec 2020 09:13:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1606986800; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=132nFXVQJMUd8IdpyU75XD6LEF8LrlNQoNesc2KuiMw=; b=syEOw0oL181o0izYOaOdkdQA6xlI0aX2+bs7uKK3w1kLQk6Gxg3B3FR/N5uoaxVowcewtx zZAME4cHcQ46TxgvMtTrMRph4L8jKbXXSSd7B34GFieExufCIgOwsAlm6q7ae4MKxLCEtP cCH/Xe+cPgKobLOp7K0QJYeyB1O2TRFN3gcyqRz5r6l7d19LVbGXkIvrAVpacvXolKDeWJ olhN8KmpdHY12u3gZBYjBgX9lmU1VKGxN2VUw8U68XO9zCoWOPKFOXAYbwqaaS+AnTGLbb LR2iHgITGtqAH83jhYY84cq6ALpjM3t/1dbTbkm+TArpi+1jcLrLxvbx6s8iVg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1606986800; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=132nFXVQJMUd8IdpyU75XD6LEF8LrlNQoNesc2KuiMw=; b=vWqgXKDQyd/qWcvX+PptreUXItEer2AtVvNTaziG6Cm9zmqKoZoYBGH2SjQmeyabNJh0Rh P2TMQCLKVOizoqBQ== From: "tip-bot2 for Mel Gorman" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Clear SMT siblings after determining the core is not idle Cc: Mel Gorman , "Peter Zijlstra (Intel)" , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20201130144020.GS3371@techsingularity.net> References: <20201130144020.GS3371@techsingularity.net> MIME-Version: 1.0 Message-ID: <160698680023.3364.529165199604253383.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 82b738de57d571cd366d89e75b5fd60f3060852b Gitweb: https://git.kernel.org/tip/82b738de57d571cd366d89e75b5fd60f3060852b Author: Mel Gorman AuthorDate: Mon, 30 Nov 2020 14:40:20 Committer: Peter Zijlstra CommitterDate: Thu, 03 Dec 2020 10:00:36 +01:00 sched/fair: Clear SMT siblings after determining the core is not idle 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. Signed-off-by: Mel Gorman Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20201130144020.GS3371@techsingularity.net --- 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 f5dceda..efac224 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6086,10 +6086,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)); } /*