Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7122282rwb; Mon, 12 Dec 2022 10:18:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf6URdA6V+jKWMz1Ph1ubhllTh4ELo4MU0i9oIVu/wGgy2mkJPsakv+QqFY2q0BZ7t4vvWkb X-Received: by 2002:a17:90b:374b:b0:219:44fd:fc0a with SMTP id ne11-20020a17090b374b00b0021944fdfc0amr19279390pjb.4.1670869084882; Mon, 12 Dec 2022 10:18:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670869084; cv=none; d=google.com; s=arc-20160816; b=nd1BmNsFZZRnoSBV3tR/NvyDyokSDwbdFN3TxuVHXATCvN3bI+9KC3Q58AwmMJ8ULq XOrvQ9dekJNEUGoV5Pxr5i+RQ9+JjvHyc2N3TvDMhC1HBTgXdhqV3xVbZ/mudonemhR4 Cpem54tGbhEu2c/Ypbu8QIT4pH1JsIgi/ukZmhY9t9BjFJlPP+x/d/nQM8ZFN0FLhGvr f3v9uEuRaiNvREAam0/CmylubHTYLPrZB4A4peSHiyziag4PytNCFmGmX0c/hrtw/g79 oYohs9mC+qh66OpyNsLS7TXOxKtBU52wv4PnCCNk2+r08SWRI/FKMqRPjTUKb5Z5hUxy QDIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=KvSX9JbBb/yViv2kJ4YwDZX6brSqXiSlOq8gpwY6n0Y=; b=Ub67p3ry4qB5yATV5In3sqldksNuhCi1mhrR67TvrdT9rB+1VtSqj8VjGoXh/ibApN lJZ/Qm+8LN+OeBU0Ikxa4V18SKomF5SSayr4+eXPfkNxDWZr3XtdauXpIv4opr3JEz2y 6rDwuahjgGuOZrLpvUfDX8QoX8ZkHplZGV14ZR17KJ2GO5BsxSS48SPUzE5QguTinqoS +BVDeu9O2RKhkt8nmrmFcDSAyaZckmrmrLMF1Q90XifUKp0+mzUmBsRurAMLwtDsKVT7 R4lEO/i3twWwGXKsdQgf1QhMoAYa3VpEhssOa3qFJ9Xnjwny4Uy509Kct2Tx51jlrH4r J0Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WE6luEiz; 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 x92-20020a17090a6c6500b00219c54ac7dfsi10159204pjj.70.2022.12.12.10.17.55; Mon, 12 Dec 2022 10:18:04 -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=WE6luEiz; 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 S232582AbiLLRrE (ORCPT + 74 others); Mon, 12 Dec 2022 12:47:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232618AbiLLRqy (ORCPT ); Mon, 12 Dec 2022 12:46:54 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8E3B13E99 for ; Mon, 12 Dec 2022 09:46:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670867211; x=1702403211; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=jsHCgo5maHdrr1Hcr1Uc9KRbzNQJfxFdzh098B2U1Oc=; b=WE6luEiz44xF55XjJaIaHdXuoSLFfXkS6LoY0iWDv9y6uGd4eTy0kOCl c0W6dbAYq4EZy+ZMGjoXGcLXQAuD1yogczY1vgDQ6n15c5laCiAnGb7aM F7BtTRWa0FfLReQVmTb8i3/rCZ1Q2Hs7yk9MdYPEDFpH8xxQqvW7X90JU zPXgYklVwcFT5Vcn+rnEvQSewnEMW27oDxOHpah+zK9ZRkRzSHHs0BR5h aPilhnEo0ShLOMcKJ2LhWlu9zxIumdeVBs+Jbhq8oBOLgZtjvnZ1OFyD3 4vipmLs5zM49rFJtE+Xrlv3j8vBk3rE7XexX87PdFKtCWMpIGq+jKCp8l w==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="317948249" X-IronPort-AV: E=Sophos;i="5.96,239,1665471600"; d="scan'208";a="317948249" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 09:46:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="822569464" X-IronPort-AV: E=Sophos;i="5.96,239,1665471600"; d="scan'208";a="822569464" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga005.jf.intel.com with ESMTP; 12 Dec 2022 09:46:50 -0800 Date: Mon, 12 Dec 2022 09:54:58 -0800 From: Ricardo Neri To: Dietmar Eggemann Cc: "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org, "Tim C . Chen" Subject: Re: [PATCH v2 4/7] sched/fair: Introduce sched_smt_siblings_idle() Message-ID: <20221212175458.GC27353@ranerica-svr.sc.intel.com> References: <20221122203532.15013-1-ricardo.neri-calderon@linux.intel.com> <20221122203532.15013-5-ricardo.neri-calderon@linux.intel.com> <75ba5884-63c0-5180-00b8-e9764306a83e@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75ba5884-63c0-5180-00b8-e9764306a83e@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 On Tue, Dec 06, 2022 at 07:03:37PM +0100, Dietmar Eggemann wrote: > On 22/11/2022 21:35, Ricardo Neri wrote: > > Architectures that implement arch_asym_cpu_priority() may need to know the > > idle state of the SMT siblings of a CPU. The scheduler has this information > > and functionality. Expose it. > > > > Move the existing functionality outside of the NUMA code. > > [...] > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 0e4251f83807..9517c48df50e 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -1052,6 +1052,28 @@ 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; > > +} > > + > > +bool sched_smt_siblings_idle(int cpu) > > +{ > > + return is_core_idle(cpu); > > +} > > Nitpick: Can we not just have one exported function for both use-cases: > NUMA and x86 ITMT? By adding a new function I intend to preserve the inlinig of is_core_idle() in update_numa_stats() (via numa_idle_core(), which is also inline). Do you think there is no value? A downside of having the new function is that now the code is duplicated in update_numa_stats() and sched_smt_siblings_idle(). I can take your suggestion if losing the inline is OK. Thanks and BR, Ricardo