Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3051146rdb; Wed, 15 Nov 2023 20:48:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFH8MPdNnkgfhc/D7pf+v9wWRF70OwiquDpDDs6/KHqcDqcdSHTst6/JjRrBwdpXzCsID1s X-Received: by 2002:a05:6a20:7f83:b0:186:5265:ed1c with SMTP id d3-20020a056a207f8300b001865265ed1cmr12429644pzj.6.1700110116311; Wed, 15 Nov 2023 20:48:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700110116; cv=none; d=google.com; s=arc-20160816; b=il9FQbUHZ0HGb2wjNF/fdgQb1/JZHrsVaeWx0achG4coVAS70oq/EtJgRfpwLwfnBy pysBThVuZbwpb5kekQSFVigwVuWNQELowzuuesMO+4PPjemSKDhhv0Y/4HW9VnId6jAy JXs9XflSQOowcC/ooerNbIbzSrNpxpzq8s350NnF6KvOpJAfetRpJ3/CLODGUMdsJOxY kikXmwE8/u4XDiGSbcdOlb0WFFu8UoVd/f71tVh+D+kH0mpKj8vZl5G86IAO27BqVI7J THZi52mIov/5bjqEi/az70UbZZ5zrfARK3hrptBMyTMHijmPoeUFOPkpC5sB0J9Hp7Oc i70A== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=13rdwJ771LtcOAeAW0HFHXiZFoyFfBWatO4Mat4LLXo=; fh=v7tmjTq3HKvG+9Mt1/P693nb5d87+reN5OFh5easFgI=; b=P/dzjnyAGIb+27v3uxyIAl4wzkmlwXRwsv9Zk+RTnfRU8tiyWHMHo3ATRMohU8Gm7X 9xClkzWoMGAakwOVqe1GrApCLztqlWLlvPfiK3gNB/4X1XjCK5uNx2b6ZPS01WbXGyMy hmmwzJ8KU93vxVgRECgLgXaGJRDP2RjQUGS1TJ4/JyyVRJab/nFwpMlpei9bp8jLMKVF C30yNMZSk0KKnI8bIzd2WQaaY6GEvSeHwjgKAEPdquIjP/fvOQ8tbw6cCW+DAyo3gUPs +vfjvm8EoA3nurG8GKefZCYlGlyne9NnFmzAiKzRS56aPWt1Vc6pZzr2balUdrbviK1/ b3jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=fDm7aHX5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id c1-20020a170902aa4100b001c613b5e778si10913270plr.557.2023.11.15.20.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 20:48:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=fDm7aHX5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id A3A6480FE2BF; Wed, 15 Nov 2023 20:48:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344653AbjKPEsX (ORCPT + 99 others); Wed, 15 Nov 2023 23:48:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbjKPEsU (ORCPT ); Wed, 15 Nov 2023 23:48:20 -0500 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0CBB4 for ; Wed, 15 Nov 2023 20:48:17 -0800 (PST) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-5a7c011e113so4359927b3.1 for ; Wed, 15 Nov 2023 20:48:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1700110097; x=1700714897; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=13rdwJ771LtcOAeAW0HFHXiZFoyFfBWatO4Mat4LLXo=; b=fDm7aHX5xVNZ/oUsXIflaXqHfyiODd3dgGzekczKoaLJDQu56ov6Yhs2cl8VGHyh+k dduEhVrsxU4r9WIeeevI9EQe9f9jveyBj9Ji2VBJqTL/y5V5ZPkc7iL8AUArQcqO60BJ 3bO2QL9i/MjBEcjLkGrwIj4l/6MC/xWJuITonpSAyOlTh4GItxDBGfh0C5OxkxW47mQC 9nWgqAnrZHlDZOSK2aKN2qaHC0mha7ZTxHiaW2szQrBHi4vlx3f6DwL7X2GoyPPz4vNu l+s4S8dOtHgNz1sRIPY4YP3hdyipAvGo53fZONZb8ch75vX8pOeCLkUD4gC5AhByiuy7 h1hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700110097; x=1700714897; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=13rdwJ771LtcOAeAW0HFHXiZFoyFfBWatO4Mat4LLXo=; b=t/B5HyQnjKPpXuVWH31xoBHEZX6t7j1v70UnSs8watY0uQWN/Rn93QnTMGU+dyzXb5 qbWtSh0LPJaQHRYpxDsfrgKDB+eUYAizTl+Sy6wKjvhtgomP0CHUmEi5uJel+AwBwmnv ozrGamdipIW0g03vI6quSVvxnQYgYIN8/WUJICx84vJFoROuJ63PL1+kyET9F/ruwQjw ATDVDfdOiUBPKTSEegwL6+fmrh254CFSSzjy/JLX223t1A0i2CJU15XWua3BNZCgdKSO ta+YzzRTjRrl3tt75JFgVhaYnGjuTmE/aQwstxhccMTCwThI/Us8/kwNtqo+VPpKOch0 x9Jw== X-Gm-Message-State: AOJu0YzJAWa4fq2BXq0+qw3n80UOb+tBjIuMBnS9OWPs5M7yupYm9mtP mSUhB63UsuiMtOM1bdLE1PJDWA== X-Received: by 2002:a81:8984:0:b0:5a9:30c3:c664 with SMTP id z126-20020a818984000000b005a930c3c664mr12430342ywf.19.1700110096775; Wed, 15 Nov 2023 20:48:16 -0800 (PST) Received: from [10.254.46.51] ([139.177.225.228]) by smtp.gmail.com with ESMTPSA id n19-20020a62e513000000b006c60b150383sm3731924pff.12.2023.11.15.20.48.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Nov 2023 20:48:16 -0800 (PST) Message-ID: <23cebdf8-1a51-481e-a8c2-e17021099e05@bytedance.com> Date: Thu, 16 Nov 2023 12:48:04 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Re: [PATCH 1/4] sched/eevdf: Fix vruntime adjustment on reweight Content-Language: en-US To: Yiwei Lin Cc: Barry Song <21cnbao@gmail.com>, Benjamin Segall , Chen Yu , Daniel Jordan , "Gautham R . Shenoy" , Joel Fernandes , K Prateek Nayak , Mike Galbraith , Qais Yousef , Tim Chen , Yicong Yang , Youssef Esmat , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Valentin Schneider References: <20231107090510.71322-1-wuyun.abel@bytedance.com> <20231107090510.71322-2-wuyun.abel@bytedance.com> From: Abel Wu In-Reply-To: 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 15 Nov 2023 20:48:33 -0800 (PST) On 11/15/23 11:36 PM, Yiwei Lin Wrote: > >> @@ -3712,8 +3811,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 (cfs_rq->curr != se) >> -            avg_vruntime_add(cfs_rq, se); >> +        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. >> +             */ >> +            __enqueue_entity(cfs_rq, se); >> +            update_min_vruntime(cfs_rq); >> +        } >>       } >>   } > Sorry if I am asking stupid question...... It looks like reweight_entity() may have chance to change the weight of cfs_rq->curr entity, but we'll never update_min_vruntime() when reweighting it. Is there any reason that we can skip the update_min_vruntime() for this case? No, you are right! Thanks! Abel