From patchwork Tue Feb 7 04:58:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 53659 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2649133wrn; Mon, 6 Feb 2023 20:52:10 -0800 (PST) X-Google-Smtp-Source: AK7set+dLHVQz3MqL/b+h3fOjDVLBwxUytvVuOEynHMHvtXIDzh9S3IyR/6dF9MjOTIIaBlgjQY1 X-Received: by 2002:a05:6a20:3d03:b0:be:8e8d:330c with SMTP id y3-20020a056a203d0300b000be8e8d330cmr2447033pzi.27.1675745530074; Mon, 06 Feb 2023 20:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675745530; cv=none; d=google.com; s=arc-20160816; b=JtyVDfVdC8T5b/lS1DsvIzCqBD4XdicPsNMeeBZCYZXdoe9CUPeL9UUspPbei0V3nd MfHLr/P2zxwFJh6UXTrbp42LDVwwoN7YB9rGpbnkyZ6WxCuEGVKRZ93U2bO5vu83O+bJ ed976Rv1KYOBy4hgidzG4qnhTrhFNrnH7371lQlxRHGbCg9gTsOcqPy4Du4eRWX6kndG 87i/5gf07NnzEk/fNyZf6mHOZq9i4JZ55r+QUwlTku6IV/HjUnpeNSMfEVMZ0UoikYwi wqxJZK3IRS+hn8AeE+Gpfn4L4p+E/p4MNkT8EGvQP+nHiYpqJCwYGQU+zFvJrAw5afdp HvWg== 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=IWL+dejvclVrWaOwRIQW+7T4EUTsGhayFHO/8YjWK6A=; b=hCrbsXWWLVnIkKeOaS0xR9V54t5wg9bbM8gMGfxulOzy+NaXOleQrJE3iDG7fLpkdT YkCp6F7HjiGp5wGaCgszOribcN3olsU6lobBZQcYjinwYZpNEYx+9ywtJBC8FHt4dnku /cBdCDKHu8zL+bZMJktkKIHoSLj8XbpaKu5eKrEVIDqEIwI1NL6/eXZJCoJifcMlqF5N YYGa/KeCfZXTC0IgjV1hBk+mcz8LnOUY+DooMCe+bZhXqXrP2vVUhB09/27fdlKn5t1B +1omSCHXxaqbgFZnCEYkML6deaiGK1Ou+EH2ZgS7sL7rHZSvC8Z6oGJATOct0XCMbVBV AGRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m+QHtUxy; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t71-20020a63814a000000b004f2d18b40dbsi14068746pgd.79.2023.02.06.20.51.57; Mon, 06 Feb 2023 20:52:10 -0800 (PST) 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=m+QHtUxy; 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 S229944AbjBGEu5 (ORCPT + 99 others); Mon, 6 Feb 2023 23:50:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjBGEus (ORCPT ); Mon, 6 Feb 2023 23:50:48 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4697E4236 for ; Mon, 6 Feb 2023 20:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675745447; x=1707281447; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=fFIXmz2jRoZi+M1l2J6uT/aihpD4LyOEaKM5OhhEq7Y=; b=m+QHtUxyPZrmE6PrVxYqy+114rJq8NQRahcbGxK1WkKLm6C3qj4XncPd CfQeKVLWC+z/pB2xZDJtWnQty11GBvC50D5dvgIMQKFrR/HCPBJvaAG97 rPVSTgWrTP5h+3nO1zRxUgBUg3sZp5feiJrgSy9b9yB1pU2ouMs+ush6m eGaPmsbxz1r4xmP9obo10xQjvwNl7pp9AQjjx6Lm+ODJZOcNvGlHphXyJ Q7RE4XyY5mSbEImWSOEG1kgTuWgAAq08FqjVp2dS9MB9zwrj71Lqlp69B VoFeokdbEMsYUdd3Y1YsfNzTVb6AXDbh8N3aFBTWZDnLnp+S1dLG9mnVs w==; X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="415623986" X-IronPort-AV: E=Sophos;i="5.97,278,1669104000"; d="scan'208";a="415623986" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2023 20:50:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="668653782" X-IronPort-AV: E=Sophos;i="5.97,278,1669104000"; d="scan'208";a="668653782" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga007.fm.intel.com with ESMTP; 06 Feb 2023 20:50:45 -0800 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 v3 02/10] sched/fair: Move is_core_idle() out of CONFIG_NUMA Date: Mon, 6 Feb 2023 20:58:30 -0800 Message-Id: <20230207045838.11243-3-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230207045838.11243-1-ricardo.neri-calderon@linux.intel.com> References: <20230207045838.11243-1-ricardo.neri-calderon@linux.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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?1757146545060686163?= X-GMAIL-MSGID: =?utf-8?q?1757146545060686163?= 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: 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 Signed-off-by: Ricardo Neri --- 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 df46e06c9a3e..767bec7789ac 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;