From nobody Fri Apr 10 12:39:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A00FC3814E for ; Tue, 23 Aug 2022 11:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358245AbiHWLlU (ORCPT ); Tue, 23 Aug 2022 07:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357577AbiHWLfn (ORCPT ); Tue, 23 Aug 2022 07:35:43 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED89CC7406; Tue, 23 Aug 2022 02:27:36 -0700 (PDT) Date: Tue, 23 Aug 2022 09:27:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1661246855; 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=eNXJEh6juzL4Q2TA495pJ0to9UrKbJuOil7u0pTikrA=; b=ICujy1k5uGrHZP1ESKFKzzC8yoVXdhRbkgF9wXuU2sM0RSLCX/ggUEtbO6dmVxSfehraKp 9DQMCvN8SkqLGw7JnnNj6fNXFmQkaFg4Jbwatv+vdCOKFObiJB2YEOK4rLqGTDykgYAY+O 2dY0Qz57FVhVweSLxQk8mfRTh94fBG9fcGs/4XpZJrdwZG2Zq4F4FlocG2krH7FlSX/NvK WDkbs+zggxYA6SLybT9Xujl7rGSA9X9eEw+jrBH/OntAMDe3kpMS/Sta12tlNcStbE+RoK AoY3EDyJxRWSip9ZIDKSrCYDic/BtA5Zr0XmPwPLt6H7qK+wRh3xiI2cXMXL7A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1661246855; 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=eNXJEh6juzL4Q2TA495pJ0to9UrKbJuOil7u0pTikrA=; b=N6oDcuCObpUiMfH8etjErJAKAHM5hD9bl/ExZ9Sd2rdBQB6Q/6GjeJQzEPsYtBgBKNhTQo /ZCJWVAenpAK8nCw== From: "tip-bot2 for Chengming Zhou" 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: Update comments in enqueue/dequeue_entity() Cc: Chengming Zhou , "Peter Zijlstra (Intel)" , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220818124805.601-5-zhouchengming@bytedance.com> References: <20220818124805.601-5-zhouchengming@bytedance.com> MIME-Version: 1.0 Message-ID: <166124685390.401.5685584934311093072.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: quoted-printable 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: 859f206290f345c151a6005de639ba9677bf3e18 Gitweb: https://git.kernel.org/tip/859f206290f345c151a6005de639ba967= 7bf3e18 Author: Chengming Zhou AuthorDate: Thu, 18 Aug 2022 20:48:00 +08:00 Committer: Peter Zijlstra CommitterDate: Tue, 23 Aug 2022 11:01:18 +02:00 sched/fair: Update comments in enqueue/dequeue_entity() When reading the sched_avg related code, I found the comments in enqueue/dequeue_entity() are not updated with the current code. We don't add/subtract entity's runnable_avg from cfs_rq->runnable_avg during enqueue/dequeue_entity(), those are done only for attach/detach. This patch updates the comments to reflect the current code working. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Vincent Guittot Link: https://lore.kernel.org/r/20220818124805.601-5-zhouchengming@bytedanc= e.com --- kernel/sched/fair.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e4c0929..52de830 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4434,7 +4434,8 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_en= tity *se, int flags) /* * When enqueuing a sched_entity, we must: * - Update loads to have both entity and cfs_rq synced with now. - * - Add its load to cfs_rq->runnable_avg + * - For group_entity, update its runnable_weight to reflect the new + * h_nr_running of its group cfs_rq. * - For group_entity, update its weight to reflect the new share of * its group cfs_rq * - Add its new weight to cfs_rq->load.weight @@ -4519,7 +4520,8 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_en= tity *se, int flags) /* * When dequeuing a sched_entity, we must: * - Update loads to have both entity and cfs_rq synced with now. - * - Subtract its load from the cfs_rq->runnable_avg. + * - For group_entity, update its runnable_weight to reflect the new + * h_nr_running of its group cfs_rq. * - Subtract its previous weight from cfs_rq->load.weight. * - For group entity, update its weight to reflect the new share * of its group cfs_rq.