Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1288442pxj; Fri, 18 Jun 2021 03:59:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/gL7Dk364GpjJVsbj00Z/f98O2WRHOKHpZPTIy87LwjUPNrqpVwLJvdVdocGZRZ644XYX X-Received: by 2002:a17:906:546:: with SMTP id k6mr10453415eja.53.1624013954286; Fri, 18 Jun 2021 03:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624013954; cv=none; d=google.com; s=arc-20160816; b=G/ADDoJUrNoeVq/lkC0n1xV3YkhIsHiVzU4rjRsxst9EWE7JahRfQ8OyzORWxqvvlU HTeV1X7MB6RQVbKMCjs/QmXLkk0I6tLeiAHwZYRin4EYve5khe10oL8NvIWD1zjk98eP zB5fYEUqO9l8azOzD5v+j0FeL2deDL5Scz0gfoa6QkN1f1sBnppg0CIOFf40R7YhRigs 1hmwJ/YryGCYZkm3di1GnPSbCPumWq01ACYEk+3GDBKaw9Uh6UPE/rC02FmRdf7sG18P trmAse51kMKBA07whXYOrZAyz/qkgbFMY5LpR80XPBSep2Rw72usBjFkSLTq+seYe0Fo aEKA== 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=rD+Z/NtBb2ny/Mr7DacuAyqlIsTFeyyxmoKadm6e44o=; b=VUqujgymLdQzFt4GlBCjoBn+YmqSgC6EWxbjgi7ObFORyDBqsa0eaDVnD8umNMD9PU ginGINqliAM8C4MS9ufi3UHxJXdWyta23MtsFGm+8FqflUUeR/2i1ToKnXQNeFJKme8v hiqKpmbqvAOl5AeUvnoLDEBhsvHd1D6p6AoU4JpvBBhjbCgm98LMZUCnjiKqCVBq2hKJ ZMLW3RjyABJkGctcK27aia6KcZJ5DTu8U4evd4Gk6PGcD7EJKEfUvkKOHvqUgG1YJTni Gt0K/fbKU4w09Y3mROqAu1zIop1P0Ui9WJ4tRrzzOJG3zAkaX5lBFkzHmq7M4G5I4zXH PbKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=O6CObESU; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn1si8472557edb.105.2021.06.18.03.58.51; Fri, 18 Jun 2021 03:59:14 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=O6CObESU; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233963AbhFRIsk (ORCPT + 99 others); Fri, 18 Jun 2021 04:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233913AbhFRIsS (ORCPT ); Fri, 18 Jun 2021 04:48:18 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F211C061768; Fri, 18 Jun 2021 01:46:09 -0700 (PDT) Date: Fri, 18 Jun 2021 08:46:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1624005967; 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=rD+Z/NtBb2ny/Mr7DacuAyqlIsTFeyyxmoKadm6e44o=; b=O6CObESUUcwluMNyFXJt4T5Tf2pAU67mRUrsC291gn0bmhfSJHjN6htf3NfE06kmY27wbP 0ANmw9zqddCdGtwD71qdHbSGXyJMPZIH3Ybae5TUd1Aj4nc1XmN9Av45PRfN7wCzLyU9Ri nhjH+51wtGU3M1EO0ITZlPep451ImbZDGrDuxv5lIsYNs2Y0arRZhGEHqwOTU9Ecp5FaW6 a4FddB8dMjbh4cD8FyIXy1WY+pXdSbG2dr1ZW3NNMrIhOUrRLit0bZF+JNk2iPtivAGW4e Ri05DMxsETJZodTyQua6V6V0dvigBXohpRDKRNSxYE/l3yV9nruzbJg1TxctOQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1624005967; 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=rD+Z/NtBb2ny/Mr7DacuAyqlIsTFeyyxmoKadm6e44o=; b=HuMk5E4co2kHQ+MmYVQQJW3rqZGWDu1lpkWbUPqfRnX4uv/+KsZQpbNclMCwDKKP3wZa2e 59hfyDl1wl+a5TDw== From: "tip-bot2 for Dietmar Eggemann" 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: Return early from update_tg_cfs_load() if delta == 0 Cc: Dietmar Eggemann , "Peter Zijlstra (Intel)" , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210601083616.804229-1-dietmar.eggemann@arm.com> References: <20210601083616.804229-1-dietmar.eggemann@arm.com> MIME-Version: 1.0 Message-ID: <162400596716.19906.6497557861624006450.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 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: 83c5e9d573e1f0757f324d01adb6ee77b49c3f0e Gitweb: https://git.kernel.org/tip/83c5e9d573e1f0757f324d01adb6ee77b49c3f0e Author: Dietmar Eggemann AuthorDate: Tue, 01 Jun 2021 10:36:16 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 17 Jun 2021 14:11:42 +02:00 sched/fair: Return early from update_tg_cfs_load() if delta == 0 In case the _avg delta is 0 there is no need to update se's _avg (level n) nor cfs_rq's _avg (level n-1). These values stay the same. Since cfs_rq's _avg isn't changed, i.e. no load is propagated down, cfs_rq's _sum should stay the same as well. So bail out after se's _sum has been updated. Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20210601083616.804229-1-dietmar.eggemann@arm.com --- kernel/sched/fair.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 198514d..06c8ba7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3502,9 +3502,12 @@ update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq load_sum = (s64)se_weight(se) * runnable_sum; load_avg = div_s64(load_sum, divider); + se->avg.load_sum = runnable_sum; + delta = load_avg - se->avg.load_avg; + if (!delta) + return; - se->avg.load_sum = runnable_sum; se->avg.load_avg = load_avg; add_positive(&cfs_rq->avg.load_avg, delta);