Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5997526rwj; Wed, 21 Dec 2022 09:28:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXugoMjit44w77ScfK69H+k1TKoaWjDAKXu86US97yDpbav5vED0a4g+RLD+1ICOCtk/GnHt X-Received: by 2002:a17:902:7d8e:b0:191:11ec:2028 with SMTP id a14-20020a1709027d8e00b0019111ec2028mr2804219plm.46.1671643730222; Wed, 21 Dec 2022 09:28:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671643730; cv=none; d=google.com; s=arc-20160816; b=BC88JPI2KlT4ShMSvZsySdosKb+oWspF8ZeqVy+F+9cpsTYrItkW1g9S4ydXpzqD34 1brW/v68YK7zofpgj2j26Ywz2oD5/71ejpOq0FFfyf/iAoBseXlAn7sIsMEVx8Eq/nW6 uS2rGn3mRax5b5yQL6q/2j60Vhzo0fX1eeJm7Uac34D6NaVL+BjUR9qHkclIvcJgVQX8 Rgl4zdjiavqsHgguQ1e5NFnBPX62YQIfMJs4RDaLlyfEypa9hXY9j3S2TD4HgMl/Y6ak mhSpmthXv88x6OuYPs41NZKzrGem/8s4ZdpfBZ+8Qqchtsw7sbu9eMws4Q/AhJ7mTy0p AeVw== 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=aEtbGoRNWeex+XpwxccCN7PFxrtlyCuQQNwVeSlnrIY=; b=lwh6L8q/Nk4TLzpoJrWTM9hr7P7rRYwN3m4nGZ/3JapLP/To0EsfzrRiiuHuRXP+ow hOKNTeGes+rKexwKov2jtGu/R81zsZsiqNiyI5gcJpetASBYyL3Wwgq0t0vDxpr+XePs BB0JtdQ13OtgXJ+MTeUv4TTLAkHxYOD79Eq3BQ4r/kScJYSyHWdJAkSDfiwIWE54DUmc g8zjGry/vf9JaS5E+WTKg6vGYHG5FjCdxrRj2bnOlz60WpRm8Ttt/0juC6S1xx89T88f AYzh8TMoa+MVcO6dooChzvz94cnhfWK8pnJ0ac17E4TAiC8czrR3km1Xg7r8JRv+1ih3 6l2Q== 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 l2-20020a170903244200b00189d297243fsi19049390pls.254.2022.12.21.09.28.41; Wed, 21 Dec 2022 09:28:50 -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 S234802AbiLUROP (ORCPT + 68 others); Wed, 21 Dec 2022 12:14:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234797AbiLURNg (ORCPT ); Wed, 21 Dec 2022 12:13:36 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 96EDB2528C for ; Wed, 21 Dec 2022 09:13:05 -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 918922F4; Wed, 21 Dec 2022 09:13:45 -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 EF1053F703; Wed, 21 Dec 2022 09:13:01 -0800 (PST) Message-ID: <72ed59b5-c7e1-c425-d1b6-e8d703d11d7a@arm.com> Date: Wed, 21 Dec 2022 18:12:52 +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 3/7] sched: Teach arch_asym_cpu_priority() the idle state of SMT siblings 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-4-ricardo.neri-calderon@linux.intel.com> <20221212175433.GB27353@ranerica-svr.sc.intel.com> From: Dietmar Eggemann In-Reply-To: <20221212175433.GB27353@ranerica-svr.sc.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 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 12/12/2022 18:54, Ricardo Neri wrote: > On Tue, Dec 06, 2022 at 06:54:39PM +0100, Dietmar Eggemann wrote: >> On 22/11/2022 21:35, Ricardo Neri wrote: [...] >>> + * 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() > > In these places we are comparing two specific CPUs, of which the idle > state of its siblings impact their throughput and, in consequence, the > decision of attempt to balance load. > > In the places were sched_asym_prefer(...., false) is called we compare the > destination CPU with a CPU that bears the priority of a sched group, > regardless of the idle state of its siblings. OK. >> even from SMT layer on !x86. > > This is true, but the default arch_asym_cpu_priority ignores check_smt. True. >> So I guess a `bool check_smt` wouldn't be >> sufficient to distinguish whether sched_smt_siblings_idle() should be >> called or not. > > But it is the caller who determines whether the idle state of the SMT > siblings of @cpu may be relevant. I assume caller being the task scheduler here. Callers with `check_smt=true` can be called from any SD level with SD_ASYM_PACKING. Imagine an arch w/ SD_ASYM_PACKING on SMT & MC overwriting arch_asym_cpu_priority(). `bool check_smt` wouldn't be sufficient to know whether a call to something like sched_smt_siblings_idle() (is_core_idle()) which iterates over cpu_smt_mask(cpu) would make sense. >> To me this comment is a little bit misleading. Not an >> issue currently since there is only the x86 overwrite right now. > > If my justification make sense to you, I can expand the comment to state > that the caller decides whether check_smt is needed but arch-specific > implementations are free to ignore it. Not a big issue but to me if the task scheduler asks for `bool check_smt` then archs would have to check to guarantee common behaviour. And the meaning of `bool check_smt` on SMT is unclear to me. Since only x86 would use this so far it can be adapted later for others if needed. [...]