Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp972273pxb; Fri, 22 Apr 2022 15:40:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypNk+V2frDSbt/N5rxJaR19QQGAXVc2khy2r0XtEO1CaF0WRxrwHog1SiAar+uVRw9OEFU X-Received: by 2002:a17:90a:c20a:b0:1d7:4cd5:ac82 with SMTP id e10-20020a17090ac20a00b001d74cd5ac82mr9251689pjt.212.1650667256900; Fri, 22 Apr 2022 15:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650667256; cv=none; d=google.com; s=arc-20160816; b=a7z0YOd6IRxYtS9svFnWVuvG+DHS8mPMvjW9G0MDkqW7iMSg+CygXJdrivUoGQ0TSe 2nOGFjM1TN8MxOAORp6V440VSSv5efeYzclMn+Ov3cXnxciUUGU5fc24NX+ellC1LQf/ rYB9T+ck0NU6F3P43XIBThX8xSjhV8m+ul58871y2zFt2uat47jMmkBH7ezPcSCt6jbD lf+e0YLvbh5qCHp5CF7N387JbAaw1GSyY9NwzCI3HU2z54RHm1w2U6wWJhOQAXGjmGQ5 ZJjsk6QpWLPsglAQLSnlauSr8//ZIRpEQykvKBjpzdt/d52iuLBPxWZtr3LmwJhRQQrM n6nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=zPXaOQL3NXUYE9kl7HHkpeh0vpgKQ6N6nf97xgsUtBE=; b=fGeO9AJfW4f9gp9sEC2vckmJQHcS069P91zSVAdSIVVV1xfBlHNwXnjUrnygdvMuoc iMJkg2/R5X26V4vqBlmmIe4Z+fds3zMHzgMXvdLlizI/fdlOL+AgyViOjMSsStN85sWt JYVqV5+j4/eqVRa/ACWVkvYuIHdeTyhIwAL4wCdL+cOEO76s8qLYVTWlNoaUWq1KKvbI QWwmXOyqX57kfYu4gHkKXfgpUlwSunQrvlttYD3DflrvDPOlYu8MaVR+uLmCNb1dkLca PeNMOSV8NRRjMI+V+hf49M7axejJeJyFqgqDG7coEEYFHaOvQ5C83Ss9nkX7zEyU+H90 tWHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3AP9zqoS; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=DMg7OC8E; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 20-20020a631354000000b00397ffaa5f06si10054269pgt.718.2022.04.22.15.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:40:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3AP9zqoS; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=DMg7OC8E; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9CC9727D16B; Fri, 22 Apr 2022 13:28:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446429AbiDVKaw (ORCPT + 99 others); Fri, 22 Apr 2022 06:30:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446548AbiDVKaj (ORCPT ); Fri, 22 Apr 2022 06:30:39 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39E5B54BFE; Fri, 22 Apr 2022 03:27:46 -0700 (PDT) Date: Fri, 22 Apr 2022 10:27:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1650623264; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zPXaOQL3NXUYE9kl7HHkpeh0vpgKQ6N6nf97xgsUtBE=; b=3AP9zqoS627EzmgRmmNR714tVe3DxXhlvYS3oKwA+7D2BGzYZ9EMAPi+MCBneQ9gSqOh8g Mkzs741RpGgmweALftxiCjX/wonqGXV3SgsngN9kq63/bQzPcE+ZpPC2HVl5OhOi3netya ceP75c2/edm1Di/OZ5Av0JfigIbp3pB+CG3SzaIk2ML+v9nf4LAajpNK8HhJGyk3RhwoQ6 OeCrcMs35HmPY/6CzdbT4J/j9sNVXphUCXQ7T2Fmrx2+pdG3sUrsGkHTWyfdL3VD60H1UT AOovbQMrPvmBYQ1bxJH1x3NQRvRPtmXLhbW+hDLzETYPpK5VHCgV2HM4y5MRoA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1650623264; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zPXaOQL3NXUYE9kl7HHkpeh0vpgKQ6N6nf97xgsUtBE=; b=DMg7OC8Et3qE8fS1HS1zsb2kizd9iwnDowxK3DpjnvH95VkStsuLaVoEiKXvof57AyRDIj iuz9kJrf9gXqe7DQ== From: "tip-bot2 for zgpeng" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Move calculate of avg_load to a better location Cc: zgpeng , "Peter Zijlstra (Intel)" , Samuel Liao , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1649239025-10010-1-git-send-email-zgpeng@tencent.com> References: <1649239025-10010-1-git-send-email-zgpeng@tencent.com> MIME-Version: 1.0 Message-ID: <165062326374.4207.14680824957826150562.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 The following commit has been merged into the sched/core branch of tip: Commit-ID: 06354900787f25bf5be3c07a68e3cdbc5bf0fa69 Gitweb: https://git.kernel.org/tip/06354900787f25bf5be3c07a68e3cdbc5bf0fa69 Author: zgpeng AuthorDate: Wed, 06 Apr 2022 17:57:05 +08:00 Committer: Peter Zijlstra CommitterDate: Fri, 22 Apr 2022 12:14:07 +02:00 sched/fair: Move calculate of avg_load to a better location In calculate_imbalance function, when the value of local->avg_load is greater than or equal to busiest->avg_load, the calculated sds->avg_load is not used. So this calculation can be placed in a more appropriate position. Signed-off-by: zgpeng Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Samuel Liao Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/1649239025-10010-1-git-send-email-zgpeng@tencent.com --- kernel/sched/fair.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d4bd299..601f8bd 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9460,8 +9460,6 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s local->avg_load = (local->group_load * SCHED_CAPACITY_SCALE) / local->group_capacity; - sds->avg_load = (sds->total_load * SCHED_CAPACITY_SCALE) / - sds->total_capacity; /* * If the local group is more loaded than the selected * busiest group don't try to pull any tasks. @@ -9470,6 +9468,9 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s env->imbalance = 0; return; } + + sds->avg_load = (sds->total_load * SCHED_CAPACITY_SCALE) / + sds->total_capacity; } /*