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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 46036C433ED for ; Wed, 7 Apr 2021 10:15:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08716613A7 for ; Wed, 7 Apr 2021 10:15:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350812AbhDGKPt (ORCPT ); Wed, 7 Apr 2021 06:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235231AbhDGKPd (ORCPT ); Wed, 7 Apr 2021 06:15:33 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF0CCC06175F for ; Wed, 7 Apr 2021 03:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=t7wWkut1jVIUYVgh1lajQt2elv3fSmdJWkrdvlDVH9Y=; b=ojgQfL1/WPhIFR70VsCXSYvPbJ 0uGeHs1Vi06xsopqNfo1K3M60sx13oPOM2lc1HpnLbLiwZ60smFlgM1l79HzRrZIhcTJ9Wf9T8UsJ 6PWWYm49AVHFpT0jJjIavRL9ue7b5H8fe2aR8kGN4KsABQC8ayw4JvjCprmZVDwPI+OrLvROMAC6a +P+b+9RVpqR6vSMTj2Q+588tcXftQQ3VAo5mw0npgc1HvScnl/85Z7h5QKDwOeBR8ZP+ceJm+AhPG 9Ye08jSRbPOWZkRFUaja6bAe8QX7nYhGunHIe0kTrEvlG7kw0SvtsCTrpiQlP4tvgnuL0IVjRL7YE OHy8vitA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lU5DO-004heK-2h; Wed, 07 Apr 2021 10:15:14 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7A9BF30005A; Wed, 7 Apr 2021 12:15:13 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3DDF224403D94; Wed, 7 Apr 2021 12:15:13 +0200 (CEST) Date: Wed, 7 Apr 2021 12:15:13 +0200 From: Peter Zijlstra To: Mel Gorman Cc: Rik van Riel , Vincent Guittot , linux-kernel , Kernel Team , Ingo Molnar , Valentin Schneider Subject: Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently Message-ID: References: <20210321150358.71ef52b1@imladris.surriel.com> <20210322110306.GE3697@techsingularity.net> <20210326151932.2c187840@imladris.surriel.com> <1e21aa6ea7de3eae32b29559926d4f0ba5fea130.camel@surriel.com> <20210407094106.GC3697@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407094106.GC3697@techsingularity.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 07, 2021 at 10:41:06AM +0100, Mel Gorman wrote: > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -6112,6 +6112,27 @@ static int select_idle_core(struct task_ > > return -1; > > } > > > > +/* > > + * Scan the local SMT mask for idle CPUs. > > + */ > > +static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int target) > > +{ > > + int cpu; > > + > > + if (!static_branch_likely(&sched_smt_present)) > > + return -1; > > + > > + for_each_cpu(cpu, cpu_smt_mask(target)) { > > + if (!cpumask_test_cpu(cpu, p->cpus_ptr) || > > + !cpumask_test_cpu(cpu, sched_domain_span(sd))) > > + continue; > > While I know that !cpumask_test_cpu(cpu, sched_domain_span(sd)) was > done previously, I found it hard to believe that the test matters. If > target/prev share a the LLC domain, why would the SMT siblings *not* > share a LLC? I think the reason for it is that a cpuset might have split the siblings apart and disabled load-balancing across them or something. Then the affinity mask can still cross the partition, but we shouldn't ever move into it through balancing.