Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp70712rwl; Thu, 6 Apr 2023 13:21:42 -0700 (PDT) X-Google-Smtp-Source: AKy350aCMgniS+qz5DpaL22NqZs7X/JSCRq/aIvuJzRVgCQJCGH2sd8X8WfdtffGtL4BV5U4AiGe X-Received: by 2002:a05:6402:11d1:b0:504:781e:7f44 with SMTP id j17-20020a05640211d100b00504781e7f44mr358832edw.20.1680812502445; Thu, 06 Apr 2023 13:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680812502; cv=none; d=google.com; s=arc-20160816; b=aJIrrGkL04PLIkiN5vP4jW4fARJOFzrrc3a0TNETMWqLikmwef3gZrWhvLfyHPHZxP prGpOiiUpzkDe6Sv5ecdR1M6OpeCBGj4Ah2UcIqUyDPFkpgeRMa8Iifif+42SGPPEVpZ zJ3rQAXUgQqTNvWXJxz79GYXo6LDVG882htfsqxOyvBMMrlAneU3zb1zb5fU+6CtiTDJ mWso5DXFgnQyQbYAupga5LTUG19cMSO3GV96FQtsQwHAJvOqiDtx045FeSkc8nVk/oVq yCnqg7zIzoRpYtCuwqQAPJMZq4oGYt9Q5tQbd1FFPY6NJ6Ldtp3cATvMKPJk8PXhS9Kd RyWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=zUCLRi5jYnEs/FXCMWDhDCwxVe1g3/DjeXlCdG6hezA=; b=DfiFArCiJB1/h7feDHm1t0u8FT5Htq9l9v3pNofwUts2tAyPxHOn+sXW91mJ10/+dR d3TK7XGdCXRNws7YaB6UaUAslIXXoSdJSIJAhYQVFsI3xHEcuFy6YkFgfj9isFRfsEuw nshFyuXRebzHCif1HrXt4cEA9Hxk6EO5wusto5Coc9dM/yTEBPBX57brdK3noxU5ZVjA dS/3PrRDD0BsmW0Nn3rNmeZhE3teXIwaAbAf30bzc3NjnSuzofrujg0CTnX+2M/hJf+Q So92ZrZzk4QMnx14nqcAqEgRRY9A2zfM6Ovwhp1ne1+/YbMsZavmmwNVpCR0/dmvRzIT quaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b37sCMB2; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a056402124800b0050291c9456fsi1708298edw.383.2023.04.06.13.21.17; Thu, 06 Apr 2023 13:21:42 -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=@intel.com header.s=Intel header.b=b37sCMB2; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238985AbjDFUVE (ORCPT + 99 others); Thu, 6 Apr 2023 16:21:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238703AbjDFUVA (ORCPT ); Thu, 6 Apr 2023 16:21:00 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AB927692 for ; Thu, 6 Apr 2023 13:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680812459; x=1712348459; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=dBo+2oyasEPbc6Kv2uSN0+SDRqjJ2q+cpoQFxON8Tfg=; b=b37sCMB2sxppooeoHmlI2Iub23mn3N9A4OzURlJyVALGq7eIKxid1blX wjB9hdx1UtPNsRlsdmr+L+Q5Q8WdgYZLFDb4tKlAVxOR/58Qhm5eXMiiU X09h9cmJKNZwbCTz9PRcmLxkbZg1u3lRFywZJdvgR7DevTMYJ5wjFvHj1 wsAHlwIB32PssVkMHiHn5KM1M7TMc3bc4WBQHn6T0rWotxg1ndeQgyg8U qxXIDZF8V2o8NyqJDfuVsNov5kVc/VCSUCp2SPWdfcyrEBlYePDxQfbxC hF4PJAURLY5gwX9rjBtjXvUQmUpimzYWTgxircBEIZe/2FEgMsTQoDQwB w==; X-IronPort-AV: E=McAfee;i="6600,9927,10672"; a="407957696" X-IronPort-AV: E=Sophos;i="5.98,323,1673942400"; d="scan'208";a="407957696" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2023 13:20:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10672"; a="861529866" X-IronPort-AV: E=Sophos;i="5.98,323,1673942400"; d="scan'208";a="861529866" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga005.jf.intel.com with ESMTP; 06 Apr 2023 13:20:57 -0700 From: Ricardo Neri To: "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot Cc: Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , Ionela Voinescu , x86@kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri , "Tim C . Chen" Subject: [PATCH v4 01/12] sched/fair: Move is_core_idle() out of CONFIG_NUMA Date: Thu, 6 Apr 2023 13:31:37 -0700 Message-Id: <20230406203148.19182-2-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230406203148.19182-1-ricardo.neri-calderon@linux.intel.com> References: <20230406203148.19182-1-ricardo.neri-calderon@linux.intel.com> X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 asym_packing needs this function to determine whether an SMT core is a suitable destination for load balancing. Cc: Ben Segall Cc: Daniel Bristot de Oliveira Cc: Dietmar Eggemann Cc: Ionela Voinescu Cc: Len Brown Cc: Mel Gorman Cc: Rafael J. Wysocki Cc: Srinivas Pandruvada Cc: Steven Rostedt Cc: Tim C. Chen Cc: Valentin Schneider Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Zhang Rui Signed-off-by: Ricardo Neri --- Changes since v3: * None Changes since v2: * Introduced this patch. Changes since v1: * N/A --- 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 4dc1950ae5ae..57c106fa721d 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; -- 2.25.1