From patchwork Wed May 10 13:49:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 92136 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3639292vqo; Wed, 10 May 2023 06:51:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4s6hGxARftYFp1uAlpIJqLwdwhV5l4rzYK1cB3DyrXx3GPkZLKfEM1inUTSeuUUIhQ2Tuc X-Received: by 2002:a17:902:da90:b0:1aa:ed81:5d7f with SMTP id j16-20020a170902da9000b001aaed815d7fmr23290266plx.8.1683726686766; Wed, 10 May 2023 06:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683726686; cv=none; d=google.com; s=arc-20160816; b=J+FL7D7LfHxvgtFmUPMeFQn6ae++l8W0lE4ltt5EMohYPrLDd92WCM/69VK2CirVbf sDuy4oGbN1enf7dZtC52PwoWvySKQFz3E2KtGhwE2VEKaEFTTWxFUOikH6xJ96jsABn+ MeBEolV3dLi5Ec8MC6zJpM8Tuj9InssK6AMUZnhKnIc2xWuQJDPDuvL9Aycc54nTq7NQ P/qLN/ingrV7Iqhyh/Axc5rB+pmKKAdn6ZhLfV5qTvawMD+WbGN/SgtGhGO2lodv0iBz UN3Izn+vkq67h+FaAh6ZJMGmxmzIEI99DJIRgCwgUpXAHL1mXMlkMgxyIbKKQMzvS4JK YEGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=5Qa6epiS/rQZ6R6hQykpfIRIE1kFbFThqRMJpi8z/Ro=; b=UXgoGT+MWIxYkkcstDNsPNTP7+NKYG5kmJoxRsbe259/kiuDHqZSXfDfHmAM6e9JzE WOG+Xmzgi+bGDAh8W00YeWJLlENL7MCzt3lB27WLlEZw4ScIkFP7S8geeFwYdG9jtpoK rAXFH4MV2XI7sCtw/3maqDRyEzOFkiKSCYDT1LLvNb05GUpMSv/XMw5a0ja/GzzCBsYR MefhrdYpdcUxFSk+xkg0qsd1SqAeFae9zRbNiA409tRs/OXzFaFrxqVgs4lVYFLPG2oq xqEq+9goPxK7gqXc8RHdV9wV5nIB1re68jQLiHeYkGktGb+Ewe2aT2MtOjytmuTkGX23 OzfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UYIHxwni; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a170903125000b001a63889512csi4516740plh.135.2023.05.10.06.51.13; Wed, 10 May 2023 06:51:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UYIHxwni; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237343AbjEJNuP (ORCPT + 99 others); Wed, 10 May 2023 09:50:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237281AbjEJNtY (ORCPT ); Wed, 10 May 2023 09:49:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EF1A469B; Wed, 10 May 2023 06:49:21 -0700 (PDT) Date: Wed, 10 May 2023 13:49:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683726556; 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=5Qa6epiS/rQZ6R6hQykpfIRIE1kFbFThqRMJpi8z/Ro=; b=UYIHxwniLV3tlvYSngJ/wxmw3CImKjnBLbm9EnQwCyWPh02SXTn6xWKAF9av+falLlbEwB 4l3/l7v+ZJnUGMSiQvNdn/jHhmIdo29HrwQDSqgtpnobodb+tNs+feGvxiCs7v3YFVW8aZ ERO1YYDJOleeeB2xAw+w+jPxnl3ZyNfwNr4lZ/4LF+dGmSkI0wmOQTIWFKDkzRsfS27HxN 4acPK/La6GO+KUg8rnHW0mAt/dPVtQ4L74P957xxxdcGLWSyjWiM2yD5VX5RoRD/eDBkt3 Je8kZtQMLlDrVp1XJGKyBdmLayv7cH+hwPQZQ59TMUcv2PQEV6SP60lkTVyjUw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683726556; 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=5Qa6epiS/rQZ6R6hQykpfIRIE1kFbFThqRMJpi8z/Ro=; b=br7TRLPXyn60a7ohtzxKpLuGg8BCfsKD4c738Nlj3tVB2ETG43QpvXl2ngTFmHG6x5CU52 W6uuwsysMH54IHDA== From: "tip-bot2 for Ricardo Neri" 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: Move is_core_idle() out of CONFIG_NUMA Cc: Ricardo Neri , "Peter Zijlstra (Intel)" , Zhang Rui , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230406203148.19182-2-ricardo.neri-calderon@linux.intel.com> References: <20230406203148.19182-2-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Message-ID: <168372655561.404.2932262333236727103.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762459700966360706?= X-GMAIL-MSGID: =?utf-8?q?1765515394311446848?= The following commit has been merged into the sched/core branch of tip: Commit-ID: 8b36d07f1d63de102d464f44a89704bc62d00811 Gitweb: https://git.kernel.org/tip/8b36d07f1d63de102d464f44a89704bc62d00811 Author: Ricardo Neri AuthorDate: Thu, 06 Apr 2023 13:31:37 -07:00 Committer: Peter Zijlstra CommitterDate: Mon, 08 May 2023 10:58:33 +02:00 sched/fair: Move is_core_idle() out of CONFIG_NUMA asym_packing needs this function to determine whether an SMT core is a suitable destination for load balancing. Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-2-ricardo.neri-calderon@linux.intel.com --- kernel/sched/fair.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 373ff5f..a47208d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1064,6 +1064,23 @@ update_stats_curr_start(struct cfs_rq *cfs_rq, struct sched_entity *se) * Scheduling class queueing methods: */ +static inline bool is_core_idle(int cpu) +{ +#ifdef CONFIG_SCHED_SMT + int sibling; + + for_each_cpu(sibling, cpu_smt_mask(cpu)) { + if (cpu == sibling) + continue; + + if (!idle_cpu(sibling)) + return false; + } +#endif + + return true; +} + #ifdef CONFIG_NUMA #define NUMA_IMBALANCE_MIN 2 @@ -1700,23 +1717,6 @@ struct numa_stats { int idle_cpu; }; -static inline bool is_core_idle(int cpu) -{ -#ifdef CONFIG_SCHED_SMT - int sibling; - - for_each_cpu(sibling, cpu_smt_mask(cpu)) { - if (cpu == sibling) - continue; - - if (!idle_cpu(sibling)) - return false; - } -#endif - - return true; -} - struct task_numa_env { struct task_struct *p;