Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6623441rwl; Thu, 29 Dec 2022 16:52:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXtvKQmNv3CrZGxJ7fvbgHUQUc7G1AGZ4vqt7vW3AeMlpl5k2b3k85L3SVuj8BaSUtSXrwyN X-Received: by 2002:a05:6a21:869f:b0:af:98cd:846a with SMTP id ox31-20020a056a21869f00b000af98cd846amr32457396pzb.30.1672361567395; Thu, 29 Dec 2022 16:52:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672361567; cv=none; d=google.com; s=arc-20160816; b=fXOUlyZ8j9Hgen7iLCLyqSb4459tqHGhyUtKS1ZswmOBtNcZzb6faIpRGebNOO5Od6 aq8HSGZdszNxRB2OVC1C3Mf1urlXEstIcPEEIZPgbx2/yam9vObqg5QfODhvQvZh7vFr MGQy46CXXoGV7sUmXv+cdGdVMTlUu6ZF99VxQXjscGEP6gChEJrysvc1fG/uF+/TFjq5 3bU9QFoucxBu7iJaGA4sN2C1blyzbQ4YlcgbDfVXDDHomzcwFnzhyKlfCOlqMSCn09+o 2EPwc5GuuGfQpZ4lbuKT524ChlVtyTBPnZ4QZ94bo1g2Q6gHh2fTiXJnraaY08RqdPxk AnWQ== 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=9YGh2gBzsm53cxYJr0qBSyHJ21IJHnJuLSESUcuw368=; b=bcZm+5TzlHOwAPYsYXga9snnkwtspuzQfW0eM7FwSSK6foYqFkCG+DsGme8Hr5Oikq gYNGJNgKvL6XTCghNK6PBZPnbQdrOy7idHMy/KYij8V8ToAR+A3Fc8dtolZuavOdJ9D2 OPpUlMHgzHwKxugsrYcsBI7WIa3wrYXXuE0Bs+pX3S1FH6lJ+mPID2FUH4F8VmapYR7L U5426Seg9601yIlxgmVkpwG2FhkdvteXpoYdwgrDGJGoawZVuwIrMNFNyDiNNWaWDLTC IHgTPJYID6daySHjZBPjG9Hwq/WeYW9g0hY90CyCs7Xf7uUNUZL6RTZG6ZBb7de76iaO d/GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Tm6lw3Ii; 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 h8-20020a056a00218800b0056da577869asi20851054pfi.356.2022.12.29.16.52.39; Thu, 29 Dec 2022 16:52:47 -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=Tm6lw3Ii; 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 S233987AbiL3AIr (ORCPT + 62 others); Thu, 29 Dec 2022 19:08:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbiL3AIp (ORCPT ); Thu, 29 Dec 2022 19:08:45 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162DB12AEB for ; Thu, 29 Dec 2022 16:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672358925; x=1703894925; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TLSD84xLrq3E7FpU/gYbFvY8XOJNRklPCdivllK4z7A=; b=Tm6lw3IilztQOKgrQ5nmbw5b3w06tejyjCsjwPhHPGqGXl35sI6cwpXg OPU3o5CHeCIndq04TmzyYk08Gt1iq82Se+1BTaDInECwNmX6bRHK+LsSD /3sxV31MlKfd5j+KJI4AyrAHhwew7LXTDfouufMlYkVb/oAVV/TXr2yWs eFwiYyiWdp8alg03vYgLU35vLWew+ty3+/ZTqk0jhz5kXi9i2dv33WGLv 1k+FRf8WSQLMBYUgs5Ia0qn9NQOv/nefUuAAvZfGrGuIBmxZP7s5namEx WB/H55l1bpjGgcYEDy2AnK6XGnGPJIqYsbXgEgt1ZlSgnBbta7nLrLRLK A==; X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="348343669" X-IronPort-AV: E=Sophos;i="5.96,285,1665471600"; d="scan'208";a="348343669" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2022 16:08:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="631389850" X-IronPort-AV: E=Sophos;i="5.96,285,1665471600"; d="scan'208";a="631389850" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga006.jf.intel.com with ESMTP; 29 Dec 2022 16:08:43 -0800 Date: Thu, 29 Dec 2022 16:17:23 -0800 From: Ricardo Neri To: Chen Yu Cc: Valentin Schneider , "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , 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: <20221230001723.GA15109@ranerica-svr.sc.intel.com> References: <20221122203532.15013-1-ricardo.neri-calderon@linux.intel.com> <20221122203532.15013-5-ricardo.neri-calderon@linux.intel.com> <20221224052850.GA8245@ranerica-svr.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Wed, Dec 28, 2022 at 11:29:52PM +0800, Chen Yu wrote: > On 2022-12-23 at 21:28:50 -0800, Ricardo Neri wrote: > > On Thu, Dec 22, 2022 at 04:56:22PM +0000, Valentin Schneider wrote: > > > On 22/11/22 12: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. > > > > > > > > > > test_idle_cores() does something similar without an iteration, did you > > > consider using that instead? > > > > IIUC, test_idle_cores() returns true if there is at least one idle core in > > the package. In my case, I need to know the idle state of only the SMT > > siblings of a specific CPU. Am I missing something? > > > I guess a similar one is select_idle_core(), but it also consider the CPU with > SCHED_IDLE task as idle. Is CPU with SCHED_IDLE task a candidate in your > scenario? However, we are not looking for an idle CPU. We want to know the idle state of the siblings of a CPU. I see that select_idle_core() uses available_idle_cpu(), which in turn uses idle_cpu(). is_core_idle() also uses it. As per 943d355d7fee ("sched/core: Distinguish between idle_cpu() calls based on desired effect, introduce available_idle_cpu()") the load balancer can just call idle_cpu(). Thanks and BR, Ricardo