Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp798882ybb; Fri, 20 Mar 2020 08:15:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsLzqNvZX5lgmnBeqz8pe+3oZcZRWavgkKxU4fKGPaj+6W9+xAbgnOlRx0Lf2/qicITE0ZV X-Received: by 2002:a9d:58cb:: with SMTP id s11mr7412008oth.34.1584717343877; Fri, 20 Mar 2020 08:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584717343; cv=none; d=google.com; s=arc-20160816; b=Jjvq0+SJIwhIEuAXlNmy90TNdwIwHCYnNg8pbl0a8Pm1sYEsqT8nv6a/M8XYQQBQjP xU2e+P97/OPh8ZTiCx8HK39bJvNUi704TK3VNll0pzHqrcMpzCBKWX2YAWCSTJqiPLIC 35EvqKLFOJYW+35gFEUN7QlLB9RJYiIe9y98vTGSGDW6B6YoySwe+WlrDinyghE60swi npONa8w8vMtLYuBRyTn6/XZyD6LYGuNWgHgXxuhafUC14HlYMkpztgBD1BNvdYefQdZt y4GnsHn9zONC04KDrqUB2fP5ahlVY0Hl2y4k7YLcnNDF6pyeau+pjLNtQKsFv6VtDNMw KALQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=UDZVEfHiqZGawEu58XkGPPZ/5TZU6Qh3uPokZxJ/6FU=; b=PUbCHNZuLUPYJNWT/LJ4aMHdDrXA7PJ8cA+QQnf/KloGrY9MPB+uP0DnNDUGHQOSj3 h2z1V7YFMp613cC1c4sxJfLTyYJG3bXZrDG8F31gYtwrBGPDj9dn84oGKABRVu1caP9i LeUWxeFzEar+ae0gMFEJJUW0FbT1b57XcJXo+40Cpay0OUTkqmo+VEukI2zT3a7YUMW+ 45A6Nw8AVQiNn48ireFcJK4YEyXO8KjpYLqEOb+M/6FpOxdQp4v4bvux7fmaeyeoS+qe gMj0jtO+5WuBy7XZC39MpPkyioVplF5nadPCIw+KugV1d5vLkW5cyb8Jb4gldv79Tq6k x1/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m125si2752363oia.240.2020.03.20.08.15.23; Fri, 20 Mar 2020 08:15:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727525AbgCTPNa (ORCPT + 99 others); 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