Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3055167rdb; Wed, 15 Nov 2023 21:01:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKl2WEq0NissjLYGqMJPtCXFWxy2M1SEJVxwCoxr1+m0tV9TrYezymwVmucMmRwhOqqe5D X-Received: by 2002:a9d:6c51:0:b0:6c2:2bca:7a14 with SMTP id g17-20020a9d6c51000000b006c22bca7a14mr7467677otq.23.1700110871835; Wed, 15 Nov 2023 21:01:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700110871; cv=none; d=google.com; s=arc-20160816; b=UonpUug6pPTCDuu9MF5RQlSGfwzLol807EzicsgIrWlbQJ3h2h/FaJf2+l/gjTF5ZN DEG+7Yizf7+ePIB6PojUfPiddSi9ykLkI+bg6wNuvEpTZCBlL34N92so7Aq9aPQSmxDf 9tg8983+5JPurfiI9HFePl3E+kXMme6jaYSCr0t7aAfPRU9K0cH2F2t7Q0VRAq+n53nM GZ0dhX7/CLQzBCAQdEmjMbwCAVM9PQtO3LJCRapdD1kXG6NvkEU+VEmWb/zBBgTzZdDf UECtzHfFfoTId7jvbjpByBQMOyNhOoQFnsLr1YNuF8/k9rPLIASEoN0kLapL8QrOnpjN YwcQ== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+CcNNmY3Dtn0Exoh8rKHqvCaj6fNssS432Vz47jLZwM=; fh=E/ZRa9UJxrbXcIFVKu8KXyfyUCX0lBh7wBYVIHW4JvU=; b=MXL9J0NkLfdYr/M0t1G7zF1NNPq6nlZjfovMFDSGncjVAErWVFx115ZF46Ot8DogeJ 4stMB0QWR6ojg0APu1uhsq+IDNuY5ZPQflWjN2BKi1EJsdIWTiJ+2X/SVKiT+W5nwPuS xHkqDbvEfRfC9gfQcpd8i9nBAkNPWECJfRTSPoNJGDxBZsuVKMyZ54QhMMuFyl8QD3Eg Z9espn6FfzyUFrBCs/z1VV0dKiUWoZn/YivKcdY0NRc2xDswv5TSFEPWZB/dztx/hw9E Yp2SwFTOVODQlAeRl5kjHHMW+R/4IH7eolffSasqSJU/TU07eSW1KRs9aFiLEw4G4NCb k/yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="E/hpds43"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id p17-20020a634f51000000b005c1b313a127si5231657pgl.660.2023.11.15.21.01.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 21:01:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="E/hpds43"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 39865807E920; Wed, 15 Nov 2023 21:00:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbjKPFAJ (ORCPT + 99 others); Thu, 16 Nov 2023 00:00:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjKPFAI (ORCPT ); Thu, 16 Nov 2023 00:00:08 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAF02B4 for ; Wed, 15 Nov 2023 21:00:03 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6c4884521f6so371274b3a.0 for ; Wed, 15 Nov 2023 21:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700110803; x=1700715603; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+CcNNmY3Dtn0Exoh8rKHqvCaj6fNssS432Vz47jLZwM=; b=E/hpds43EzUFs2HlTxKUIEUq5W2JwIrR3JwdeAsmbwviscGh2eicIjcQYIq6w2CrBz VUd2TfQ9iBKOFNKdMOD0BcilWyMTGdr7QlAalflkxhwYy5R7nzHWWQc8vXuEj3OWVgzv hUdZnEZnIrrcOcORAYNy3UFT12NLyAvHojHs4JoEL017jxQPfxMoYL2KISKinHJ49zpO u360m6OcCGTDhzCm3LHb5PzSA4B4B2PsS0B+Ta86M133C4bWOgcMjbnhvXlVICPI0GRE oUtK4mEbV4sN5nRF/CMbIeJoVaYTwHotsAitZoh/O8vERnRC1sPj+RbavOSK6u25cIK9 wYQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700110803; x=1700715603; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+CcNNmY3Dtn0Exoh8rKHqvCaj6fNssS432Vz47jLZwM=; b=AXrnjeJZzi6hg22E8ol4q6LNBq/J90q6oBIN8wLZH7krsQKmYBE5CCFthI6D1LsbkT PDKvGNEHN0n6BMEJVZZrXs7DROYnn2BVTOMGW4m/xZLV7i/b2D2VNW6GeR1+jj0eYfVq SRh2JxFv+smlwSU3vEUPaHbXkOjH35VsJjpGvnutirsFDCtGuhYgV7jO9o2Caa1z9O7V KehkgKd+eD/t9B5Xlm6fDBedfsDChtgL9Ole8NLZ+QuG+YLQk//JSztO7JfN8a+KJzpx 3nEug2A4nN3dkk/H61Bzqe6hg7Qg4w6uvgXYo4wWzvNaDVFW9ZhXuFYAG3hkkttVeonE WOXw== X-Gm-Message-State: AOJu0YxmxhCm29Q5paasNKrs8f9BPw94bHh1ULDOl+RLNSDgkEz6Axdh 7nWvtVnSl1FNproiLWtF8Kc= X-Received: by 2002:a05:6a20:2323:b0:187:652d:95c3 with SMTP id n35-20020a056a20232300b00187652d95c3mr2911085pzc.56.1700110802938; Wed, 15 Nov 2023 21:00:02 -0800 (PST) Received: from [192.168.1.105] (111-255-239-171.dynamic-ip.hinet.net. [111.255.239.171]) by smtp.gmail.com with ESMTPSA id j5-20020a170902c08500b001ab39cd875csm8224107pld.133.2023.11.15.20.59.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Nov 2023 21:00:02 -0800 (PST) Message-ID: <4d6f0382-0012-4b22-9e9a-c659615dbad1@gmail.com> Date: Thu, 16 Nov 2023 12:59:58 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] sched/eevdf: Fix vruntime adjustment on reweight To: Abel Wu 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> <23cebdf8-1a51-481e-a8c2-e17021099e05@bytedance.com> Content-Language: en-US From: Yiwei Lin In-Reply-To: <23cebdf8-1a51-481e-a8c2-e17021099e05@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 21:00:19 -0800 (PST) On 11/16/23 12:48, Abel Wu wrote: > 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 Thank you! I'll take the responsibility to fix this. Yiwei Lin