Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2155840rdb; Mon, 20 Nov 2023 03:49:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHttPg0oKtu1ajypHSopr8dFtt1rAidVUUY0ibHiLpagxAW22UnT2Gp0HNhF/rux+4ZVSZM X-Received: by 2002:a05:6830:1552:b0:6d3:efe:f2a5 with SMTP id l18-20020a056830155200b006d30efef2a5mr8161029otp.9.1700480945711; Mon, 20 Nov 2023 03:49:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700480945; cv=none; d=google.com; s=arc-20160816; b=WjbLQkLpx3iE+Vql6WBvW6Wyh7ezoxVVjw8h1GdlBX5D7ZYNFU9nhc40VoVennoK5f dbATJVyys8IGW5Ca0OWKA9YlXr4LURmDLWJYtSuR7q5Xdr7eafDjpaZCJ3UvHVmnoOR4 NEyYIV9v4DGs0I9EWq3tjkBYJt5G21ML0OhqBECa0/lJYaybxIpTUqSteY2MT6y1VRzt GryKV9GAFl5A6rK6qC9OttHizHxCcPEtQ+EQTnCuGVa+Au9sgzads1Gchuww92d6URVU Vp3zLM1L8YoFlO7DwiYxPEeElLgvUyZp7e7G0bIdmfA4c17kGyIUwUF7ffTGzIs7WpEj J92w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tRSjvBLeRfQ7O2tsXsQTusJsAygDUJstbiZc4CjFK0w=; fh=CkbN8fELXzVWhq6P/KlH5OAIuQ26/rCU8pAQDfIyNSw=; b=EoScQ+MIwkZGDWDYxpNQD82Wo0i0zwMqM7wlaGOXB5wBtvyvx/T5njjpR82GGbNGJj uq0hSWfWIRRkpLJP4LqsKcqUuEwPqyoobL9PH3lRcedSEHO/niz+EqYWwy8Q8qwm4wWj ZAe8lo/RNqg7YggMiux3IAE6N79QraSvwex6B5AZAEa6l/BFdhStJOLE5Nebhl7MkXqS 2D24FpNhT3ATCla2ZyDYG94B2B0XHTO47lVxwPGHRnXiPhmer2ukhdfwJ7jiGY9pkUm6 rdYE34hViGRif9GsiDDRB/GVY+dCWZlMVSxXLP0J5mB8Vn0gYESWr3xsx0bj3zletnwn 2g6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=PJkslyS3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id o185-20020a6341c2000000b005bd039e5a04si8285938pga.622.2023.11.20.03.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 03:49:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=PJkslyS3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C996A8047552; Mon, 20 Nov 2023 03:49:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232947AbjKTLsy (ORCPT + 99 others); Mon, 20 Nov 2023 06:48:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232566AbjKTLsw (ORCPT ); Mon, 20 Nov 2023 06:48:52 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBECB8E for ; Mon, 20 Nov 2023 03:48:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tRSjvBLeRfQ7O2tsXsQTusJsAygDUJstbiZc4CjFK0w=; b=PJkslyS3n0J8xbNI52IL+Qqxv5 fp2UQiM38h25OoXaQzJgznpaaXpfp2CqWBYLtqtOE64DHZL+ESsmuQLBH95UBcg6+EKRD+d1/CS8I 0un5Mm+ww+Ps4ZMfIEIldGlfd0gMN2bsEMpeqJURsnF1ro6I/mlHgAtxlIdJ+9WpTYf+qCYWKWqIR U66BZXp6jopYx4ftXSFGf0pltVW7DEf6FRvJdU1u5VuLYEWXmje0JfPodkA2AZnmkAmdC5PwrYDpT xpyBUGnxWtQP8a6rCeP3UPgJxZNOb9g+95sWOnxMeIUKKsJN0eu+/Ja4PSv0SnDjYyuoxsAJYbYfn EHXLllZw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1r52lX-00AwDo-2n; Mon, 20 Nov 2023 11:48:37 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 25EBA3004E3; Mon, 20 Nov 2023 12:48:35 +0100 (CET) Date: Mon, 20 Nov 2023 12:48:35 +0100 From: Peter Zijlstra To: Yiwei Lin Cc: mingo@redhat.com, wuyun.abel@bytedance.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org, s921975627@gmail.com Subject: Re: [PATCH] sched/fair: Update min_vruntime for reweight_entity() correctly Message-ID: <20231120114835.GS8262@noisy.programming.kicks-ass.net> References: <20231117080106.12890-1-s921975628@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117080106.12890-1-s921975628@gmail.com> 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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 03:49:03 -0800 (PST) On Fri, Nov 17, 2023 at 04:01:06PM +0800, Yiwei Lin wrote: > 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 Right, but as you wrote in your other patch, min_vruntime isn't all that critical anymore. I'll go queue this in sched/core, I don't think this warrants /urgent. > --- > 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 07f555857..6fb89f4a3 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); > } > } > > -- > 2.34.1 >