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 8974EC352A1 for ; Tue, 6 Dec 2022 17:54:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229575AbiLFRyu (ORCPT ); Tue, 6 Dec 2022 12:54:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiLFRyq (ORCPT ); Tue, 6 Dec 2022 12:54:46 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EDE812BB11 for ; Tue, 6 Dec 2022 09:54:45 -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 2969423A; Tue, 6 Dec 2022 09:54:52 -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 78C8F3F73B; Tue, 6 Dec 2022 09:54:41 -0800 (PST) Message-ID: Date: Tue, 6 Dec 2022 18:54:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 3/7] sched: Teach arch_asym_cpu_priority() the idle state of SMT siblings Content-Language: en-US To: Ricardo Neri , "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot Cc: 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-4-ricardo.neri-calderon@linux.intel.com> From: Dietmar Eggemann In-Reply-To: <20221122203532.15013-4-ricardo.neri-calderon@linux.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 22/11/2022 21:35, Ricardo Neri wrote: > Some processors (e.g., Intel processors with ITMT) use asym_packing to > balance load between physical cores with SMT. In such case, a core with all > its SMT siblings idle is more desirable than another with one or more busy > siblings. > > Other processors (e.g, Power7 with SMT8) use asym_packing to balance load > among SMT siblings of different priority, regardless of their idle state. > > Add a new parameter, check_smt, that architectures can use as needed. [...] > Changes since v1: > * Introduced this patch. [...] > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index d18947a9c03e..0e4251f83807 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -142,8 +142,11 @@ __setup("sched_thermal_decay_shift=", setup_sched_thermal_decay_shift); > #ifdef CONFIG_SMP > /* > * For asym packing, by default the lower numbered CPU has higher priority. > + * > + * When doing ASYM_PACKING at the "MC" or higher domains, architectures may There is this new CLUSTER level between SMT and MC. > + * want to check the idle state of the SMT siblngs of @cpu. s/siblngs/siblings The scheduler calls sched_asym_prefer(..., true) from find_busiest_queue(), asym_active_balance() and nohz_balancer_kick() even from SMT layer on !x86. So I guess a `bool check_smt` wouldn't be sufficient to distinguish whether sched_smt_siblings_idle() should be called or not. To me this comment is a little bit misleading. Not an issue currently since there is only the x86 overwrite right now. > */ > -int __weak arch_asym_cpu_priority(int cpu) > +int __weak arch_asym_cpu_priority(int cpu, bool check_smt) > { > return -cpu; > } [...]