Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1275633pxb; Wed, 6 Apr 2022 13:24:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI2IbZfanZIedtLNXqTmt/V6MHNUg/GgQFKwPoa5Xhcnl/T1wratFcl9flfEtzF0aHeM9n X-Received: by 2002:a17:902:b189:b0:14d:6f87:7c25 with SMTP id s9-20020a170902b18900b0014d6f877c25mr10595889plr.31.1649276651684; Wed, 06 Apr 2022 13:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649276651; cv=none; d=google.com; s=arc-20160816; b=Ys6OIJo5PD5MhcK8w7syu5n0C2Nm2tbGsJgl6wkIY7pm7Nh+q0Gqj68/stvaI1LuuK X52wgUHYehywPr9NsnqeGRZUEHgfq84tBI1fhO2BXfQF//EAmPKqZt0D5o0UD8gfGLgl 5mvTyWY+0bCzhHn7dVOaEn3A3a87oeqn4dR8zDvTqbtU3eiRtLW2+Jhl3FfTFip0tiOr jc3eYuMi61nrHXUOmnN1K2JWCSM6it9FHiFBLIdwtPV3KaKqSA/VLKh3rPFEzORIRduH CahVX1BaUALfnb2T/7WkvzkR7pbBFgrzVsT4vCSvqr6qd8uir+AEN1S1yej4A2Jipb7S la+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id; bh=2vXQUnh/qIJ8xHVEUJFTpW6cIolfrsrU4mW0AmDRMR4=; b=dzDnuXtmb17NRDSldAtrcpQtCiy/Lgqoa60M3RB73vIHszBhnnYoBOxJGiXaM3Gb6V FPDjrBUoFV+I3lw7ZDKzuFjmSGsu3KuecxX0uTiV9uXOwPRhxl/YbImkN9XSqM83oM0d y2dLYWK1H/z45SsFK8FAC0tL8ZTH/2e/k27WhfEo58jNea0kpKmREY9VOoPwmOlFWg7u Frs91IDqruj6B/POmKoFXvgoRuHfZp80kpx+kTx6utD8oNEn21Akb+IpGlK7lIztr0WX A6SrIRqnPxBeNW/sUCrzOTWLpfGrZ/7F4cS6didwOjjaNMIMev7VeK0k2fk05iWuqubO Fihw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020a170903019000b00151f8f6cce5si17413797plg.3.2022.04.06.13.23.57; Wed, 06 Apr 2022 13:24: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233082AbiDFT6s (ORCPT + 99 others); Wed, 6 Apr 2022 15:58:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233195AbiDFT4e (ORCPT ); Wed, 6 Apr 2022 15:56:34 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3CD9619C80A for ; Wed, 6 Apr 2022 10:26:10 -0700 (PDT) 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 0399612FC; Wed, 6 Apr 2022 10:26:10 -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 890FA3F5A1; Wed, 6 Apr 2022 10:26:08 -0700 (PDT) Message-ID: <44ca58cf-3daa-bec5-2c52-eb5a6dd305b9@arm.com> Date: Wed, 6 Apr 2022 19:25:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: Dietmar Eggemann Subject: Re: [PATCH] sched/fair: Return the busiest group only if imbalance is meaningful To: Vincent Guittot , =?UTF-8?B?5b2t5b+X5Yia?= Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, Benjamin Segall , mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org References: <1649244204-23471-1-git-send-email-zgpeng@tencent.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 06/04/2022 17:33, Vincent Guittot wrote: > On Wed, 6 Apr 2022 at 17:07, 彭志刚 wrote: [...] > I think that this case should be covered by an additional test in > calculate_imbalance because we should not try to pull load in groupA > if it's already above the average load. Something like below should > cover this > > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9469,6 +9469,16 @@ static inline void calculate_imbalance(struct > lb_env *env, struct sd_lb_stats *s > > sds->avg_load = (sds->total_load * SCHED_CAPACITY_SCALE) / > sds->total_capacity; > + > + /* > + * Don't pull any tasks if this group is already above the > + * domain average load. > + */ > + if (local->avg_load >= sds->avg_load) { > + env->imbalance = 0; > + return; > + } > + LGTM. Like for the `local->group_type == group_overloaded` case in find_busiest_group() where we force `goto out_balanced`. [...]