From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E376EC433ED for ; Mon, 17 May 2021 15:35:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4E1F6124C for ; Mon, 17 May 2021 15:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244231AbhEQPgy (ORCPT ); Mon, 17 May 2021 11:36:54 -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. [...]