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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08C47C4332F for ; Thu, 22 Dec 2022 11:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235390AbiLVLMo (ORCPT ); Thu, 22 Dec 2022 06:12:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235364AbiLVLMl (ORCPT ); Thu, 22 Dec 2022 06:12:41 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C9A9C2AC8 for ; Thu, 22 Dec 2022 03:12:39 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0C49AD7; Thu, 22 Dec 2022 03:13:20 -0800 (PST) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AF1953F71E; Thu, 22 Dec 2022 03:12:36 -0800 (PST) Message-ID: Date: Thu, 22 Dec 2022 12:12:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2 4/7] sched/fair: Introduce sched_smt_siblings_idle() Content-Language: en-US To: Ricardo Neri 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" 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> <20221212175458.GC27353@ranerica-svr.sc.intel.com> From: Dietmar Eggemann In-Reply-To: <20221212175458.GC27353@ranerica-svr.sc.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/12/2022 18:54, Ricardo Neri wrote: > On Tue, Dec 06, 2022 at 07:03:37PM +0100, Dietmar Eggemann wrote: >> On 22/11/2022 21:35, Ricardo Neri wrote: [...] >>> +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? OK. It's only used in NUMA balancing (task_numa_fault() -> ... -> update_numa_stats()). I can't see that this will have a noticeable perf impact but only benchmark can really tell. A `static inline bool sched_is_core_idle(int cpu)` via include/linux/sched/topology.h might work? We have similar functions (like sched_core_cookie_match()` but in the private scheduler header file kernel/sched/sched.h though. > 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. I doubt that it will have an impact but can't be sure. [...]