From patchwork Wed Nov 29 14:55:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 171414 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp392251vqn; Wed, 29 Nov 2023 06:56:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtB0Hb7Jk0964dV2gqtPWTsnnY56zoiehFHSqPzdX8/Yzb6vnISYDNjnbx5COY7sK75xRD X-Received: by 2002:a9d:6c96:0:b0:6d8:49a5:907 with SMTP id c22-20020a9d6c96000000b006d849a50907mr4630326otr.22.1701269771019; Wed, 29 Nov 2023 06:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701269770; cv=none; d=google.com; s=arc-20160816; b=aS6lX5lfQFvZ/vNmR5pOOcjx23Dbi/bV/D/O+FiJSSi+mWs4Mmzcu1idJT4SmdsVLc YnGU9Ad9IAwBvFDaMLQ6FlTPNbxxp31JwXMIDYfDaHZlLBSqD1EzFJNoHH2JU83A3S5t I4VIZ78+VPgrfPbTSMDVx/OqvTPB/dxSD8CZhoOmKhmb0nD+DaGuUIki3fI9YiJjZmM3 YJts/sT2jkRZ+DrReCLsPMU5DCRd2N6cnpb3rurWPn2mX4taLiAtJQDRSnFNXhEheUXk hWrtqrZl8vfI4TRI6xWj9sh39yLeaqZ/f2nFdL4XuRsbLscog+LYoqs/9d9x8q7NT5nJ gJRQ== 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=9WEPXGYdbhKOooWioB6jRt0QqF0avzhckQjBmlIoo6s=; fh=3TkQnR+djg/6N1Qa1so+mGYK/ydMZbMF4/dItL4VbJ8=; b=xOQ3xoFO67zW93Ad9RdArwL1d8+kMWSODp4ozfQvrOTelj/elgbb4PxIpReX803omn Laz/Vao/nxOzjFFd2F/33cV9yEkUWyGGTflL+u6kMjg6vvtlk6Fs2As1q+17LXWMCEkv zfpASVIWzo819F/zsTjtLGcvJ+dglEemhfD/ragTuMlq2Znuzbuiax2+3PjUBXJB9eoT fk60Wqmu6127HiswQRHqO00rSTRKVEngJ/xCu4YDSD6sZxq3sg1xWczvUDBQ6JX5QQ/+ nh01u56mf3eO955/XY+E7opOpn8tUGtk/tFD7MTF23edr1jIBPvQFuqbiE/nJniMtczr 8M1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=My0aKc0D; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id i30-20020a63585e000000b00565ead2509asi14049960pgm.199.2023.11.29.06.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 06:56:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=My0aKc0D; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CDDBB802177A; Wed, 29 Nov 2023 06:56:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234733AbjK2Ozc (ORCPT + 99 others); Wed, 29 Nov 2023 09:55:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231488AbjK2Oz1 (ORCPT ); Wed, 29 Nov 2023 09:55:27 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9D74C6; Wed, 29 Nov 2023 06:55:33 -0800 (PST) Date: Wed, 29 Nov 2023 14:55:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701269732; 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=9WEPXGYdbhKOooWioB6jRt0QqF0avzhckQjBmlIoo6s=; b=My0aKc0DwrDN+B2kIHZ/l5PICx7jDel/R0tESE7iWoG8Ri1hbbj2fmETLLEhGzuYeikrkc W2FnlaO0nysWqXmb+8qCkKADiGfI66x02PSHaDUOtb6RTZlXAAWjXap5LCk7WAVNPAjol6 xa8PRROJqaGnUAZSUEG3SULm+8EwzsMFDg3Gx6P97faTYtUpTLYwgiJ3QYoAhMFfb3DWHk qi15KfJt8kMyF4yPD/wv2rsJnx9iCHHfkzhZURBMsRiwkxID6GtNwBT0ceikd9DEJVyK6V iNilBh1Ub1kK3KnyW4h9ODSzFzPyUHS3NO7hxMm6roC7tKcJG9GivuSpGtNAsg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701269732; 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=9WEPXGYdbhKOooWioB6jRt0QqF0avzhckQjBmlIoo6s=; b=S6hnk1FdRW0ls8EP3MkrvyCZW6IUWts27ZJIJyBMARX90E+KfdWAtsISUlD8DGYBhfn0Kr jOtLoEjlWiYtzFCQ== From: "tip-bot2 for Yiwei Lin" 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 min_vruntime for reweight_entity() correctly Cc: Yiwei Lin , "Peter Zijlstra (Intel)" , Abel Wu , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231117080106.12890-1-s921975628@gmail.com> References: <20231117080106.12890-1-s921975628@gmail.com> MIME-Version: 1.0 Message-ID: <170126973174.398.17001381623417224269.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 06:56:08 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782797409669372740 X-GMAIL-MSGID: 1783910651305403202 The following commit has been merged into the sched/core branch of tip: Commit-ID: 5068d84054b766efe7c6202fc71b2350d1c326f1 Gitweb: https://git.kernel.org/tip/5068d84054b766efe7c6202fc71b2350d1c326f1 Author: Yiwei Lin AuthorDate: Fri, 17 Nov 2023 16:01:06 +08:00 Committer: Peter Zijlstra CommitterDate: Wed, 29 Nov 2023 15:43:52 +01:00 sched/fair: Update min_vruntime for reweight_entity() correctly Since reweight_entity() may have chance to change the weight of cfs_rq->curr entity, we should also update_min_vruntime() if this is the case Fixes: eab03c23c2a1 ("sched/eevdf: Fix vruntime adjustment on reweight") Signed-off-by: Yiwei Lin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Abel Wu Link: https://lore.kernel.org/r/20231117080106.12890-1-s921975628@gmail.com --- kernel/sched/fair.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 34fe6e9..bcea3d5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3815,17 +3815,17 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, enqueue_load_avg(cfs_rq, se); if (se->on_rq) { update_load_add(&cfs_rq->load, se->load.weight); - if (!curr) { - /* - * The entity's vruntime has been adjusted, so let's check - * whether the rq-wide min_vruntime needs updated too. Since - * the calculations above require stable min_vruntime rather - * than up-to-date one, we do the update at the end of the - * reweight process. - */ + if (!curr) __enqueue_entity(cfs_rq, se); - update_min_vruntime(cfs_rq); - } + + /* + * The entity's vruntime has been adjusted, so let's check + * whether the rq-wide min_vruntime needs updated too. Since + * the calculations above require stable min_vruntime rather + * than up-to-date one, we do the update at the end of the + * reweight process. + */ + update_min_vruntime(cfs_rq); } }