Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3230245pxb; Mon, 18 Apr 2022 19:58:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbiKOewji4PpRthFZNJhnSrEQK3dxOTF3rIs5QulN8fRI6HX27N+Nr+5ZBnl1FJjto80zt X-Received: by 2002:a17:907:3f03:b0:6df:b04b:8712 with SMTP id hq3-20020a1709073f0300b006dfb04b8712mr11646074ejc.290.1650337091097; Mon, 18 Apr 2022 19:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650337091; cv=none; d=google.com; s=arc-20160816; b=brlC3PYPMykeJhb+bgN/fIFjFvpO7ABZUmzIT5GFiEwUzY2lDwQUZQootTEDzdjiTc igZrVF5DQkQEQ6LdAC7TgSSEqNpWEstKhAFBje6EK+/mlZgLkuwjwTCmxvwnWPS2G3ML TuXtzeITuiqewOP6aSKaOm1xmvyinBkUp3Ze4CZxCBXXOdNr1Yvr2J/OOHn2QO31s4TC jltsW9uRkG11GKdp6nR9iM6vSio/X5tIoB6+SNmeC6yq15/7HV73fPhxJF/FlROWBvsv didf3jX5GftPZBUqJgxq3V29U0fV1ETKlOnKdUhmTQ8deFiq5hgSv6uVl5vcTfWHY/8F 4HeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=r/je8JVUXl8iO8OZzWyd+9Ej5Eexy/v/eR62ghwrS0I=; b=uqR3z+tV+vRPDRfBMxSN268pSURjXiX3pX2MaT9aePqNz+97FZP/mKeDGiKOUoykSI bjqzu5hHnZQoxu+2KxNGWHhHjJE29pojprybFn/NP87rPZxMNcn/O9/ZQE/8Ki25APGF /8dK5mHnN8tOF9JsGiOjPgsYDwU6hPwGTPLd8pwUZwi0p15SS8K1+Jbcsw10MUb3py0S ki2fXtbkhEKHz+v6QQNqu1MLjYL4O+SHu5N2RJMQ6p/J9LQPKG26OmR31Uy7DFzkKqyv kxHp0Lb25w6RYuqdKVS9Edz7Qo2mktPqJ3ad2OKN5BIgdL6g0rvKQzmeWWDlWL7YG/RN bStg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wj8-20020a170907050800b006df76385eeasi6881018ejb.906.2022.04.18.19.57.48; Mon, 18 Apr 2022 19:58:11 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233545AbiDRQet (ORCPT + 99 others); Mon, 18 Apr 2022 12:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346373AbiDRQeK (ORCPT ); Mon, 18 Apr 2022 12:34:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9920A31370 for ; Mon, 18 Apr 2022 09:31:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB498612B9 for ; Mon, 18 Apr 2022 16:31:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A2EEC385A1; Mon, 18 Apr 2022 16:31:17 +0000 (UTC) Date: Mon, 18 Apr 2022 12:31:16 -0400 From: Steven Rostedt To: zgpeng Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/fair: Fix the scene where group's imbalance is set incorrectly Message-ID: <20220418123116.2e4f6b1e@gandalf.local.home> In-Reply-To: <1649566716-24687-1-git-send-email-zgpeng@tencent.com> References: <1649566716-24687-1-git-send-email-zgpeng@tencent.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Sun, 10 Apr 2022 12:58:36 +0800 zgpeng wrote: > The specific trigger scenarios are as follows. In the > load_balance function, the first loop picks out the busiest > cpu. During the process of pulling the process from the > busiest cpu, it is found that all tasks cannot be run on the > DST cpu. At this time, both LBF_SOME_PINNED andLBF_ALL_PINNED > of env.flags are set. Because balance fails and LBF_SOME_PINNED > is set, the parent group's mbalance flag will be set to 1. At > the same time, because LBF_ALL_PINNED is set, it will re-enter > the second cycle to select another busiest cpu to pull the process. > Because the busiest CPU has changed, the process can be pulled to > DST cpu, so it is possible to reach a balance state. But is the next cpu selected really the busiest CPU? Or is the original still the busiest but doesn't have any tasks that can migrate to the dst CPU? Does it really mean the parent is now unbalanced? -- Steve > > But at this time, the parent group's imbalance flag is not set > correctly again. As a result, the load balance is successfully > achieved, but the parent group's imbalance flag is incorrectly > set to 1. In this case, the upper-layer load balance will > erroneously select this domain as the busiest group, thereby > breaking the balance.