Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp413058pxj; Tue, 18 May 2021 06:17:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRZCiR60l8FjzL+tdGYCAg8U/LblUoc/V5eYXEdE3Hlo+CGkBYtrIS6Hqb/yetHmyo5f2O X-Received: by 2002:a05:6402:c8:: with SMTP id i8mr7102466edu.57.1621343849404; Tue, 18 May 2021 06:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621343849; cv=none; d=google.com; s=arc-20160816; b=TByBqQojYpO0cRsbjx3MvDKgIw6w2/Wf9VioIzoQbap7Obih4H0zmdpCK0776/BNBk 9CEN3p4v8OlvIfJrijpQDWRAi2RVtlbbzupWbQ0iLkwxX8G2s3VQpT4l+oul8xBy0fG/ EAEd2cmp+/fewfwPiHgfYitXRQOa2H0aDnh/lXgVMjVkJQcXZQtR9kpalYhM+zvLg+Io g/NjZ9aKRljqDU1JuWiEXMEzEAzzn2MhBuU2y9pBK0t6BgV3j6RR1AI18gEnEDaldykh K1Cw0NHTSrGB107qqrGnRns1bfHJuYkabYilI21C2bkTB8bS9lGjzGWuKl/pO28YxHNt uNJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=CAUss6dw9RXItrDLKsbj2/FUUSKwar8V73i/QVQCXS4=; b=oZvrpf64v+EWyDb5eGLi3Fk7RvWPGJ7eeg/zyZEBZvxS0Ot2LM5gDKqN7rtUEyZMUy YdGqEuQXJdnbbGXlzBHctjKpECpjodraMBLgnNPg4nQFET2gU5Jv/llq7rkp2DuBdPEf bV+EKziGPvBbbvzBd44kQdZ8swLpTA5egI4f9rdI7DhyLBZuTtuEmVjtRvpl/39GTcZc viQz2NryCa+rAy/DMHqwJMjCRG4uU7RpOS5GtTt/c5PdssIaC7EI4IedwugxXk3YNp8E 0Qohig+8fN23zlOPO2wgs5FxoJCxtsp84Lc7td7oGu/vSJNOn15bRM/3feaOMhxAzglq csOg== 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=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si20929979ejc.493.2021.05.18.06.17.06; Tue, 18 May 2021 06:17:29 -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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244009AbhEQPgi (ORCPT + 99 others); Mon, 17 May 2021 11:36:38 -0400 Received: from foss.arm.com ([217.140.110.172]:55282 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244281AbhEQPTz (ORCPT ); Mon, 17 May 2021 11:19:55 -0400 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 BBC02106F; Mon, 17 May 2021 08:18:38 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 390A23F73B; Mon, 17 May 2021 08:18:35 -0700 (PDT) Subject: Re: [PATCH v3 5/6] sched/fair: Consider SMT in ASYM_PACKING load balance To: Ricardo Neri , "Peter Zijlstra (Intel)" , Ingo Molnar , Juri Lelli , Vincent Guittot Cc: 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 References: <20210513154909.6385-1-ricardo.neri-calderon@linux.intel.com> <20210513154909.6385-6-ricardo.neri-calderon@linux.intel.com> From: Dietmar Eggemann Message-ID: <3e346f3d-45c4-bd8c-57d9-a11feda42834@arm.com> Date: Mon, 17 May 2021 17:18:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210513154909.6385-6-ricardo.neri-calderon@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. [...]