Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1599156lqg; Sun, 3 Mar 2024 19:02:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWq5pBh847hAugcdeGGyoxtWIA0zDsshE/FtWreN7QWnoVserPRXHK+OXLxLGbFSQ8tupZyoNA8OAo+iFeyf+uGNxSDaQqbYsK6cF3o2Q== X-Google-Smtp-Source: AGHT+IHI+44M85r7B091xz415CwwPPzwkKyoWbPiioVWjqDSd6q9yEmdnmw1d6Z4XtdnRUI59MCm X-Received: by 2002:a17:90a:fd89:b0:299:9999:6bae with SMTP id cx9-20020a17090afd8900b0029999996baemr4965447pjb.16.1709521337448; Sun, 03 Mar 2024 19:02:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709521337; cv=pass; d=google.com; s=arc-20160816; b=LUgfqiUifahV+OcrUHyMGk+toMmQWf9Od7wgp8/QJEj9v39NT5jJG4WmpXk0LoVKNs X2ipvAnhrlezh4IpbbbWLBD33xxC/0YOb0a35KsKH3X1e4nPO+0Ej6wqPIaFWQ6ZfN8F nmMaTDd5DDDf1JnfLKS1d/EjkSaDNJ+eINpuOyjHyZ/uCybA7lUNFppUX+6ig/ctO2zk WYaNjV5oMugU2k+gtTDXYukmVUFUWNr1AgIOOnmUecA0yWDyy4fTrMlRojomYzZFEdJP Ok5hgvc0ipGlOJ4OsLiR7EXQypQM4c5oL9YQFtJEoC0wRbTQVV1XwXEX5A7RtpFtvh+1 UkXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4u7FtZOI33xmYIt3T0Rn34srhvB3CoeuSZKAdi4JZLQ=; fh=HGPOwMD1U+bU1zkI6pk9BDAYYJSoTCIazwWVkER0sVk=; b=IV4Dhj3AOmJ4FqoxXEkotHBVja7i8pSs3icUoD5RiMuvKDRZif2NUWU9Aaa8A3/pTQ K2qiOIEPu8pK6imCHee9PAKeUM7cdaXBMMaMWlp7a6dk/TfrrwhOGGc7aJdAMcegmAWX 6WVCtBZ7fHkleuaEUgBaDE9q7RUUU6+0GRMt+2WSG6jCNzPEHYasEBiLWgsegRqE7329 Cy6dwIVbIZHRjnNLE3Na0jx80KnpFdUKJ+XgqvjIFrg2+dGUtgf/Cm7CU3Uz7GQVrCEq Syk+W0oUG5r/JKkbbIw0q3LNZxVzhIZxiE9bAvRK3+3/smKux55AmtA4FiI1KoTguflW l+yg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=ReLNKGfZ; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-89996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id qn7-20020a17090b3d4700b0029a1aaefe30si7795081pjb.188.2024.03.03.19.02.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 19:02:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=ReLNKGfZ; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-89996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8B584B211CB for ; Mon, 4 Mar 2024 03:01:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 780D96FB0; Mon, 4 Mar 2024 03:01:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="ReLNKGfZ" Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C97F04A15 for ; Mon, 4 Mar 2024 03:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709521261; cv=none; b=aN3hmu+2DqZ8NG70i1u1ZyCx1NEWQTnGe7DpdDRVA+5qjwFRXjzXqX5YDO+VDSimrXmoRWoXaEVxs3xOQigoRh0e0jkAqu6OuUNedW0WQHUuk0JAKzqWt1Qo1n3N1pLhpR0GfdgCbLOfBoyEd+qDNpq2QhOQhtcEHmhmZ4GNpjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709521261; c=relaxed/simple; bh=/na5pr5dBEKR/drn7nkYD2RUThEAWD8UrRCZ+1HtChw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mD6S8EWfmfQNncZ/sBn0cmphuRPxpPr7OzAsMAit+HZslgjcdAOnMUqcK2UJjPBkjuDxHbnIZu6q9s/Xy9SKDRClABZpEVsRhKaUNyKbzupLI/YupNza7f2FTV5uuYbguyTAatWz7TtiqO4XHdFCvgmN6XQyE5aCUKHRISrx0Ho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=ReLNKGfZ; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1709521250; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=4u7FtZOI33xmYIt3T0Rn34srhvB3CoeuSZKAdi4JZLQ=; b=ReLNKGfZyE68O0Ahlr5OC2PFykZxYgv8s3P7C2jqqkpaO/z5Hi2F010IhPkFyia6Y47VvKhszNYhof9TEdoLF0pJQgYEHd3k0FGwwcWZG+UY8KcGXI+WgbAXwGHQAv1ZaENwA2gH1sXpMFQ+uodgasF0wete2vEtbW6rnlZpU7Y= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R381e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=dtcccc@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0W1i0XYV_1709521249; Received: from localhost.localdomain(mailfrom:dtcccc@linux.alibaba.com fp:SMTPD_---0W1i0XYV_1709521249) by smtp.aliyun-inc.com; Mon, 04 Mar 2024 11:00:49 +0800 From: Tianchen Ding To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Abel Wu Subject: [PATCH 1/2] sched/eevdf: Always update V if se->on_rq when reweighting Date: Mon, 4 Mar 2024 11:00:41 +0800 Message-Id: <20240304030042.2690-2-dtcccc@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240304030042.2690-1-dtcccc@linux.alibaba.com> References: <20240304030042.2690-1-dtcccc@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit reweight_eevdf() needs the latest V to do accurate calculation for new ve and vd. So update V unconditionally when se is runnable. Suggested-by: Abel Wu Signed-off-by: Tianchen Ding --- kernel/sched/fair.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 03be0d1330a6..5551ce2af73e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3790,9 +3790,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, if (se->on_rq) { /* commit outstanding execution time */ - if (curr) - update_curr(cfs_rq); - else + update_curr(cfs_rq); + if (!curr) __dequeue_entity(cfs_rq, se); update_load_sub(&cfs_rq->load, se->load.weight); } -- 2.39.3