Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp340816rdb; Thu, 16 Nov 2023 23:34:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6nZqQCK5UUVvFoDXuiEiDhvcoMVsCHPXJzoTrZmxhiYQmm05CwjahfTAzmUy9cC6mpQG8 X-Received: by 2002:a05:6a20:7fa7:b0:186:ae16:103 with SMTP id d39-20020a056a207fa700b00186ae160103mr16099326pzj.30.1700206490709; Thu, 16 Nov 2023 23:34:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700206490; cv=none; d=google.com; s=arc-20160816; b=obcAs3346M3JOmjxWZfHxFlXuTS7Yq8iKVTyETpjo7gKCNcGAuUSOmTrXuWnxvsy+1 rariZ5fQ7uu3ypqvSbk9SuR1Vbo2qa+ZGq4i2wZ8QwqzOkoJLuYSkKVLDAVPRdguj4Ew Mc3ihqNp2fwq4FoRotjWaPB+3uz2srDd4XBhlq83p6I6uFM3wBQSuvgNrgL1LoXOo6b4 xhGW98/MlBLTyWoxdTLE7T3xa1RQInr/i5AseEg6sFPsG277zSlVQvGQgG6lNK4XevR3 +q48rHAh77adTwZYWkXLuzuLbTCfoYd33gojBr7/T6GwcqxvwquP60ms06D7RySoDNLR Fa4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=hfKYY8OtNB3CHpmzLXf6dJoRO471vghEnpe2oT0xnQw=; fh=/Gr2IyLrDzgrhPCwrknev+0bxCSC16laiEOahgaJnq4=; b=beMx29ad0tLxIOoqThkgf0VbnsyconGEcocbYgjFVWs1sGwpUgWjAYKwF6lXUy2lsG DlmdQl+ykl+HyTg9kgzGTHo+MdqPVbjO87ZyaXte4jWU+AKWDhK+N4FcKZc0jIUKFomf 0hJ4qtm62XS+6KA+ivRHIgxIP7+tQRqq6uZjIByjhwOfl/85bVTRrZDm8qODE9ow/SpT lElH/qr+VJbyz3sOjxHXB8P3POPRLYoQgB+2c29IDNNNowrB1aq0Y2fRujJiBWZNtRhM 8Klsgs+ADsg9Ve+w/ahmlibLRp+HnPI3vI8taH3VTAxySQRCDk5bpW9h5x8m7x1Kk/c2 raww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=dgHBoIds; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id rm11-20020a17090b3ecb00b002839cfc9e4asi277420pjb.135.2023.11.16.23.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 23:34:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=dgHBoIds; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2B58781BC49E; Thu, 16 Nov 2023 23:34:48 -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 S230149AbjKQHek (ORCPT + 99 others); Fri, 17 Nov 2023 02:34:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbjKQHej (ORCPT ); Fri, 17 Nov 2023 02:34:39 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59FEB109 for ; Thu, 16 Nov 2023 23:34:11 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1cc34c3420bso15213055ad.3 for ; Thu, 16 Nov 2023 23:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1700206451; x=1700811251; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=hfKYY8OtNB3CHpmzLXf6dJoRO471vghEnpe2oT0xnQw=; b=dgHBoIdsUZJJnWlWRt21Y4YbMNMl1OxEr8URsztQP6hOn1TAbwJcuNMJxldYoslQvS 546QKZ86rppxSArn+Jg/v7EVgP1VVUyOk/mYSM9HUTcmwtM958KrZBiKuAJRiJ8By1kC vJNVu4IicwgPFA/keA+LGMajrNC3A1uC7VjIFPDNjiKQwOKNAdOYYYMgIL3SxMaXDyFF 2PJC56vKjPmf4vYYfCEUeysUMAVqXZCycPo2J23EHSYQVhUErvLr/yXnGDcfe/xy0jAR xNL7ruLyHR77oU3ZcVXO1iSqTa99fu7I7PwNAHBcWGb8pDAgEJR/ZhWHgCwAV5Miwi94 dcig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700206451; x=1700811251; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hfKYY8OtNB3CHpmzLXf6dJoRO471vghEnpe2oT0xnQw=; b=r/0Eqkq84ZHcwMAPAgvkIKlLpfAHRp3js/Nqe7EV0Bb+5+vnZQEcH+beZPnTkQjXQe oKB/gz33f02moMX9/H/RPu7hmFe72bYw0HrPXbHcnaXg8l+O34qxwQHln3T19I7S0kk5 3naprTxvEM3jrSbqqfHU+1Nbt8nQZXjSSFCzu3Gk8lkkK4zktbSDFMvjoXtN/J8TU8GX hDGnW9FY6qIkT9Ctaazk5d659fSmflSouZrayBeDcbzJtkLByhr+hiZJkJQ0EBYk6t2z zRdo1dsZ2sBISWGbOmChseTZsdUyQnVwt9TyLnlwgm4V11q75yVfXLyO7VOgnFgKVZDA y3pA== X-Gm-Message-State: AOJu0YyQ2qjQOImIIMriEw5PVEGNeLyRBW4zkghVB9Q5YZFY03LEuGI7 rZhvW7eeDmmEbAvLUUF+VR3+qg== X-Received: by 2002:a17:902:74c3:b0:1cd:f94b:1823 with SMTP id f3-20020a17090274c300b001cdf94b1823mr10332060plt.64.1700206450781; Thu, 16 Nov 2023 23:34:10 -0800 (PST) Received: from [10.254.46.51] ([139.177.225.228]) by smtp.gmail.com with ESMTPSA id a18-20020a170902ecd200b001cc2c7a30f2sm782047plh.155.2023.11.16.23.34.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Nov 2023 23:34:10 -0800 (PST) Message-ID: <96194f8a-4e3f-4563-83d0-c754e1d2abd3@bytedance.com> Date: Fri, 17 Nov 2023 15:34:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] sched/fair: Update min_vruntime for reweight_entity() correctly Content-Language: en-US From: Abel Wu To: Yiwei Lin , mingo@redhat.com, peterz@infradead.org Cc: vincent.guittot@linaro.org, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org References: <20231116114217.90553-1-s921975628@gmail.com> <30fa2ed2-dfee-4dbf-bb44-1b0374877706@bytedance.com> In-Reply-To: <30fa2ed2-dfee-4dbf-bb44-1b0374877706@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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,URIBL_BLOCKED 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]); Thu, 16 Nov 2023 23:34:48 -0800 (PST) On 11/16/23 7:52 PM, Abel Wu Wrote: > Please add a Fix tag like this: > > Fixes: eab03c23c2a1 ("sched/eevdf: Fix vruntime adjustment on reweight") Can you resend this patch with this fix tag please? > > On 11/16/23 7:42 PM, 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 >> >> Signed-off-by: Yiwei Lin >> --- >>   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); >>       } >>   } > > LGTM, thanks!