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=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 B56B1C4332B for ; Fri, 20 Mar 2020 15:13:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93D2C2072D for ; Fri, 20 Mar 2020 15:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727548AbgCTPNa (ORCPT ); Fri, 20 Mar 2020 11:13:30 -0400 Received: from outbound-smtp11.blacknight.com ([46.22.139.106]:52741 "EHLO outbound-smtp11.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726951AbgCTPNa (ORCPT ); Fri, 20 Mar 2020 11:13:30 -0400 Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp11.blacknight.com (Postfix) with ESMTPS id 59CC91C3711 for ; Fri, 20 Mar 2020 15:13:28 +0000 (GMT) Received: (qmail 30708 invoked from network); 20 Mar 2020 15:13:28 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.18.57]) by 81.17.254.9 with ESMTPA; 20 Mar 2020 15:13:28 -0000 From: Mel Gorman To: Ingo Molnar Cc: Peter Zijlstra , Vincent Guittot , Valentin Schneider , Phil Auld , LKML , Mel Gorman Subject: [PATCH 3/4] sched/fair: Clear SMT siblings after determining the core is not idle Date: Fri, 20 Mar 2020 15:12:44 +0000 Message-Id: <20200320151245.21152-4-mgorman@techsingularity.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200320151245.21152-1-mgorman@techsingularity.net> References: <20200320151245.21152-1-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 7f4356c520be..41913fac68de 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6005,10 +6005,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)); } /* -- 2.16.4