Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp821757lqs; Tue, 5 Mar 2024 19:08:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXYKRUQVa9SjOFga25UwZjst5Ql3tDbqNF7/nq+CMRw/8NXF83ya4sQiS8S0QTWvqH8h5MVGLvdonlE4nfjdMYpWoHGMoPY02pZJon75A== X-Google-Smtp-Source: AGHT+IEIGUDe3zdU08GLvsU1vBZ0avHvDtPr03pqaetqB047x7DT7uHIPJh/dK1pkEA8llISCAjg X-Received: by 2002:a05:620a:f90:b0:788:2149:2a60 with SMTP id b16-20020a05620a0f9000b0078821492a60mr3574338qkn.72.1709694481002; Tue, 05 Mar 2024 19:08:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709694480; cv=pass; d=google.com; s=arc-20160816; b=MKYLBZJbAczQC3gqSeuMFDiLpPKfhxJ1TyNdTLDN1G64pWEbZB62APWPjvZQOB/wEy KgwFuzI9SJ4mV2B1PYyqmdUctIy+gGOMPhTKo/i8dkt6WhAS6j9WkNp8ZuQrEpxWNpqQ FdDe05mnQfuWDTr6XcDWdwlXXk9+awCdTK40zzPahIh4xwALXKcZGP87/I+PVAoQLeGL ZLQAX24ZeF2kv1hO9s2sNxLUaVSGLtK21XQleHrJITTrB8Ev5Uc0TUcu7bWNT/KlzpDb +y4Gr/y6x8Mt4U7pdGtIU/34XgiqCFkti/RH5HwrNLuzCbAOzMHY0bkVwRIYGtswHKbu 88XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=fpYzOvRaHq4gHEmEypaVl6DouqaHn7yaLW4F5xgQiHk=; fh=4KImoBIGNCBPTY1VkFDLj/5ic3+wVhOUUPKyk6LQhKo=; b=xmkW8XmCTyDDaUyPmWQGRvjPeMdV4Sp9rVvE1VHqSCOsHSvmu8DCQEXL2dztXqHEed Hs1AbehOj5VSUIXdhT3Pb1GlVI/w3CqqK8hJu/C9VRsiLtfGL3PZpt81WpqAdRx3iCSB KnrQhvZuFSZBwXI0gjofjAaovjp0T16xiFzDZmKsT/BpCDIezzPcOMWFv4SMwVA/BLlT itW7C3NRsLx3spc4bL/YDE8tpOiTw0Enp/i5B5lTwLz9p2Gp0G7A8PYNdrtPcI3ILlI/ GpK93JE79QNq/wHVVqmA/JZW84lvBYMkVUMeQlgfAXQWkOgauixYr3hmV4wkeTY+yiZA pkMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=DlJRNxMm; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-93264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v12-20020a05620a0a8c00b00787a8c79efdsi4928352qkg.370.2024.03.05.19.08.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 19:08:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=DlJRNxMm; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-93264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 84D2F1C25E3E for ; Wed, 6 Mar 2024 03:08:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57DA5101D5; Wed, 6 Mar 2024 03:07:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="DlJRNxMm" Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D9DCDDAB for ; Wed, 6 Mar 2024 03:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709694476; cv=none; b=D/tWGYzcUIwTw+QXUA9LnQxm2UMh3+QoW3V8JIdeahpdbKaHvKexerg9d8YcOU8oSYGGjCktjmdp1+JitXrmXkzzgxygCNPMOdMHh+rqA3d4A+YCaOz6njTFhWSS1WATdJaSTwpvRFwkks5yq454pM9wws+An4wqpMshkYvtTtE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709694476; c=relaxed/simple; bh=Vtwk64MJfFurchghTacEBkuQ/GO/QTdi/78Hoc2Pm3s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KSd7gZsLOnWwoqWnApeikVBY0s/gOIsdfNunhrOeJEarvqQ2abUQI82wNmpa3mdLA+t/Jyf71RYiqd3e8dhphjqVFLi8xpbOPNkawp6IhQuPiK0G+76Ls0nMPnDfCEMdI/9oa5Of5OJA4D43OElrJeX6ooQv/Aq+4UcD+Juhmlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=DlJRNxMm; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-29ab78237d2so4386019a91.1 for ; Tue, 05 Mar 2024 19:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1709694473; x=1710299273; 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=fpYzOvRaHq4gHEmEypaVl6DouqaHn7yaLW4F5xgQiHk=; b=DlJRNxMmxSvW4Nh4AkV1ahQMFBtNScEn5fC8/zo9dykb9ehHuXOPXNJHMhByFqTWq9 AOD6oNLq0JWwdrZ6wkckWi7Boa22luQNcEJW8IeUEiLqcWtOhv3fnhizKp4ea9zMDCYf ge3zyU03iPgYKP4JyFKHuVb9W1Yw6QDz8Jesn12EdR6B1bfwnIoj4hT+XYKwA6sNaNDE B428hH3SP5eyx+u5bIOS596aJrca0ukjjRve251GpJ+F5mzKOK42Mrd2vxCXpf6D0Kw7 h48C2q6Yr7QJ/nmaAzB0/Z0r644smjXCtVM7p7ublPOXL+ZnuWj5kOrmr3QkcNO96YL4 xEgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709694473; x=1710299273; 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=fpYzOvRaHq4gHEmEypaVl6DouqaHn7yaLW4F5xgQiHk=; b=AfiPfzhI5g0C7nnWSSRq5GD/ZxYjSvSuRyw34ja5QYzIHWaALHtCFoux9ATa0b7DkT 7lbdgnWHOvV6HN+eoF5E37MbraxgYrOHJ0aDMWhFLtTBk9YWHh31UhvfkRJYeXrcVYtX oaFTN7c/8zzuzMULegvFMSt/dKoYar52Nt81vBfBvBLlUCFg3Bp4ipL/hTEoc4W2HMBP oTc+DXpdIIqQNA5Ucm/P137Ikmf1TNQS0b0XJR13enFpe/VTf420PjOHLMIMO2ge++YG wqmTVpR6k5L/UyOG0nIZ5o1rHQ4qLfdN1MN0B8yNSkhuZOp/GZFG52tB6IrHJW4XH5fx hY0A== X-Forwarded-Encrypted: i=1; AJvYcCXeUoY0EyEKMWViKMhIpX96pAd3tOshIs4/IsQ9Cvz7xxUeRiHMem43JmMGGWdfeMbS399WHoI179M8IOsHd7M8ab1gNCcDxAqgWeXw X-Gm-Message-State: AOJu0Yx4uKi7edmicK8X4jf/Bi9mYNl+PCQ9D7drpNLLHrMdWzSUJXCh BOmlEg6n/td43pMtIo5dRRHt/1y2VPLdk6nh42uL2RZUVWk/hiK8SIFw+Xe5o9w= X-Received: by 2002:a17:90a:5404:b0:29b:347f:23ea with SMTP id z4-20020a17090a540400b0029b347f23eamr8063152pjh.3.1709694473410; Tue, 05 Mar 2024 19:07:53 -0800 (PST) Received: from [10.84.154.116] ([203.208.167.155]) by smtp.gmail.com with ESMTPSA id m2-20020a17090a34c200b00298d8804ba8sm13624811pjf.46.2024.03.05.19.07.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Mar 2024 19:07:52 -0800 (PST) Message-ID: <10c71757-032f-4aa0-a178-cdc8cff5f2e6@bytedance.com> Date: Wed, 6 Mar 2024 11:06:31 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] sched/eevdf: Always update V if se->on_rq when reweighting Content-Language: en-US To: Tianchen Ding , 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 References: <20240306022133.81008-1-dtcccc@linux.alibaba.com> <20240306022133.81008-2-dtcccc@linux.alibaba.com> From: Abel Wu In-Reply-To: <20240306022133.81008-2-dtcccc@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/6/24 10:21 AM, Tianchen Ding Wrote: > reweight_eevdf() needs the latest V to do accurate calculation for new > ve and vd. So update V unconditionally when se is runnable. > > Fixes: eab03c23c2a1 ("sched/eevdf: Fix vruntime adjustment on reweight") > 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); > } Reviewed-by: Abel Wu Thanks!