Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7807448rwb; Tue, 6 Dec 2022 10:05:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf4IRF55DbvGD5XWtx5wk9JSOkOOmQteiGtn7T7WLAdgNANN+3oU5B5ia2gXvrfLKSUkZ3J/ X-Received: by 2002:a17:902:e9cc:b0:189:ad0c:4027 with SMTP id 12-20020a170902e9cc00b00189ad0c4027mr30829897plk.63.1670349928373; Tue, 06 Dec 2022 10:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670349928; cv=none; d=google.com; s=arc-20160816; b=SLXBQP0AVlQ3kWr+IEqu2B0IacOGth3zQ6p9PtBg8mEaF/CSO2jbMR4enyyj53y1J9 obJFcvHBEBedP6zPqseZSvUxG1ayU/JJK5joFWNVM2DzE4Pm81o/2rF4hLw7Ympcm147 BuiIZSDzvTJMD3m81a9+nwcKQwhqbGW53BYc5sS921X3/Sx765qquJhiqlP8MMwNt0Dc 9fpPWsuWI6/XiJdsRzBl2FpS19r7vJoDiF2m0l9RjT6bMxwnTXDa+b8rhE1sjdQNUIlD DTu6A8ZEzFgOwqwSQkYiDWuQt7mmEAiWg5AESyRJU8Ic5NyQJ8eaiy7hVAAazLe25Wn9 0Cqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=c2C8E6cK39CdlBmxQqIyaKMzwXjDmQz4EQ2AaGZFHYA=; b=AQGnQUKe9vuh1x7MKlyrunP3N3TVvmkEnfzQfagLpiJa4FZlFPM1ULnnHCy8+OORyp Rw1N40xt6Ac+lO6JqAIvVSidbch8KNrRCi4/FOfPEknJ5T3pjjEY1tl4cbfwMIwPbH0L 4TCLIXsTRKvA49Yna6hr5mjDfM4CNZXWLZUCkWNhe+f41+Ua3eHH71LkYhp4sfkugLNn u4RZaRgz1GcH/EDQy4pUPKLcOJU45Ary2TkWR+GSpRLszS/BHOSn4zdxatnug4d/RbSC 6+vKKPpSiQBQVFNhWhYfo90NdaCXuNIhZT7nE0MpZ54KCTPnzYUG+em+DM/dXX/W2BG7 0YZg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a63db58000000b00478775e5cdcsi15372102pgi.418.2022.12.06.10.05.16; Tue, 06 Dec 2022 10:05:28 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229572AbiLFRyt (ORCPT + 77 others); Tue, 6 Dec 2022 12:54:49 -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 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 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; > } [...]