Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1689747pxj; Wed, 19 May 2021 11:31:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7nh4Syx5CHTbX9BMKyuGq7LYnV4EdNoqPRLh+XLNzIZPzzyXxt1IjNMh3UCfemu9ij+OU X-Received: by 2002:a02:354c:: with SMTP id y12mr370874jae.144.1621449117194; Wed, 19 May 2021 11:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621449117; cv=none; d=google.com; s=arc-20160816; b=uKbkqQGF7UDvNoG+Fve3yZ3MLJ0CdZld3d7HfBw1SbFwe+6OVsp1VwwD+FJl3KHQ7Y V1ykm2u+cFNFRHpUQM8mtdbGyh/xY0zU1qViwjvabXoGzDSvq/uShkTEV6rzgxNsEWAa NL718gLLk5n3riIRtZEGOBJ3ThHeqwJU5KZi7zbAYdit/I+J1j7jgDc3JTuIUpECnOW1 /0RqAqLGM3nOf+o1bYdXotvolRJXNKurV12TEl1yPaKzyuzSzDkAx3z0z0NGwjrQ5fAx 6tIq4Bljz3VPxCcKRIQfu+Mz2swBj7C1Sh/euGnivWFkGDA9O33tvDUJCjsEEVlThqc4 DMlw== 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 :ironport-sdr:ironport-sdr; bh=0TrKIfkvq2kR3qe9Ha4n/FeXRfeoFbTKLBwupquu+vc=; b=Q8OjyMeBU/OxQYLHr82wVDMAjQrX020SceATTMdmPsoPXUu4OzFEAQbp2K1Jpu9Ptd hR4uSnuDcnqzOiR595RJ8tzOgA4ct2oieGejdetFHSVCB2hVs1k9wJe5+wZ2BcG7op7d s8J9zivOgiou/VSK5tCCPZJsIMIyA3ikw9NEV9c+HNRDQIy3Vu49/d6QQGeO8tq1T9hU iE2PeXxtJmDzoFyjEDdV29c6FkWdWwSTuh4WK2bHyogDG4643R8E1eYkJ9kgC+EiJuBM EBcGBybn8YB825GDgkC6KIUUsIVx+EHTcXqg9Q+MwKFHIlFFM8Qzr/PJBG03ZyiGkn8y bLVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si64887jan.21.2021.05.19.11.31.44; Wed, 19 May 2021 11:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240928AbhERTND (ORCPT + 99 others); Tue, 18 May 2021 15:13:03 -0400 Received: from mga18.intel.com ([134.134.136.126]:27653 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237158AbhERTNC (ORCPT ); Tue, 18 May 2021 15:13:02 -0400 IronPort-SDR: gLnCtBRxzprdP3A9vmRXbZ2NiOxQXyOPRTmQt5z1rlbnvABa1qs/m3kFgL8PB2btFSX0mt2pGv wDgok45v6/Jg== X-IronPort-AV: E=McAfee;i="6200,9189,9988"; a="188204657" X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="188204657" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 12:11:29 -0700 IronPort-SDR: Oy/DYjgEn0wFps9s1XM+TzK+IBDVccQCVmCc/glFBWPHnP6kDaVtbKEm2JxFrltlYh98jZ8Bwx 95LkY064NwmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="473956127" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga002.fm.intel.com with ESMTP; 18 May 2021 12:11:28 -0700 Date: Tue, 18 May 2021 12:10:39 -0700 From: Ricardo Neri To: Dietmar Eggemann Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , Len Brown , Srinivas Pandruvada , Tim Chen , Aubrey Li , "Ravi V. Shankar" , Ricardo Neri , Quentin Perret , "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, Aubrey Li , Daniel Bristot de Oliveira Subject: Re: [PATCH v3 5/6] sched/fair: Consider SMT in ASYM_PACKING load balance Message-ID: <20210518191039.GB15251@ranerica-svr.sc.intel.com> References: <20210513154909.6385-1-ricardo.neri-calderon@linux.intel.com> <20210513154909.6385-6-ricardo.neri-calderon@linux.intel.com> <3e346f3d-45c4-bd8c-57d9-a11feda42834@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3e346f3d-45c4-bd8c-57d9-a11feda42834@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 05:18:29PM +0200, Dietmar Eggemann wrote: > On 13/05/2021 17:49, Ricardo Neri wrote: > > [...] > > > @@ -8447,6 +8456,89 @@ group_type group_classify(unsigned int imbalance_pct, > > return group_has_spare; > > } > > > > +/** > > + * asym_can_pull_tasks - Check whether the load balancing CPU can pull tasks > > + * @dst_cpu: Destination CPU of the load balancing > > + * @sds: Load-balancing data with statistics of the local group > > + * @sgs: Load-balancing statistics of the candidate busiest group > > + * @sg: The candidate busiet group > > + * > > + * Check the state of the SMT siblings of both @sds::local and @sg and decide > > + * if @dst_cpu can pull tasks. If @dst_cpu does not have SMT siblings, it can > > + * pull tasks if two or more of the SMT siblings of @sg are busy. If only one > > + * CPU in @sg is busy, pull tasks only if @dst_cpu has higher priority. > > + * > > + * If both @dst_cpu and @sg have SMT siblings. Even the number of idle CPUs > > + * between @sds::local and @sg. Thus, pull tasks from @sg if the difference > > + * between the number of busy CPUs is 2 or more. If the difference is of 1, > > + * only pull if @dst_cpu has higher priority. If @sg does not have SMT siblings > > + * only pull tasks if all of the SMT siblings of @dst_cpu are idle and @sg > > + * has lower priority. > > + */ > > +static bool asym_can_pull_tasks(int dst_cpu, struct sd_lb_stats *sds, > > + struct sg_lb_stats *sgs, struct sched_group *sg) > > +{ > > +#ifdef CONFIG_SCHED_SMT > > + int cpu, local_busy_cpus, sg_busy_cpus; > > + bool local_is_smt, sg_is_smt; > > + > > + cpu = group_first_cpu(sg); > > Looks like `cpu` isn't used. Thank you very much for your feedback Dietmar! Ah! That is correct. I will remove this variable. Thanks and BR, Ricardo > > [...]