Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1311034pxy; Thu, 6 May 2021 05:30:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBDaWKHYWZwiLyb+axJNJ6sdqpUwM4iyLLodxz4ka53n8jUEiyZb7Qsv4Oh1X8l5hzs//0 X-Received: by 2002:a17:90b:78f:: with SMTP id l15mr17014939pjz.44.1620304217557; Thu, 06 May 2021 05:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620304217; cv=none; d=google.com; s=arc-20160816; b=0bn9gzZvIoLKtxDnP/mFq9rwKD/QimUQG/17gL9WkPG+iQ66RwVmSkUyV2ljoUtH+s t/5wD5YP05QCS2xzaPBDcNDdDXXEHn4KBiRXcjQKotSKkSmfVemzCCo9PVFqpp4fsHkf GkO31xhJWcmbuZqoXKl670ZRT0vQ1NST/kcxWdMvdSrDYSbLYr1Zlo1f57nLozMjcPK3 R/LyS1zAApOjBNOeqGZv7Cj+H/ILz30ND3ZWZRtU9tTsdR3cJ4Gd1qg837LSMEDDFWoQ F8pAAwNoWJdJs+jmb5WEdzTw7t+Q6bbWqAjWaQD206Xyb9ogGhccg+oVhXhx9/nRS/M6 DpeQ== 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; bh=gegjqH50nL4saU+frCwbmd74J4fmFo8+sDgIgDI8OuA=; b=RFoXOpKwbu02FbsZaRJsOpEGQ17/V43Kgk1pWcMYsKmiqAQWjUEg2T9oGtcBrQ+oUa qAoEZH5XFFHiBsyNumGLimQtT9PNgcUfm4amta9FXgIWQKUEZGBHsmYjwY8BA8+6m7ZH taYPlmsD6iDci+6Iy+SFw+jJhGPeU8y9YlRybbPbK2P9+tn9Zwvqlp/6VRiKAnHr7xbR E78nF+/v4TyrCflVs+/ZQ9onq/3QXAbt7ySNecfFbtsEC3PDlJVG/da8FTTB+r7COlKc ihrLjrX6D3KeKx2FVbhZUKn8zKWNEiGTIOoKISHTcvvTMJDQ9MZba2A+T9xi5hQ6ZJvY QXVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si3053641pgt.378.2021.05.06.05.30.04; Thu, 06 May 2021 05:30:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231441AbhEFM3b (ORCPT + 99 others); Thu, 6 May 2021 08:29:31 -0400 Received: from foss.arm.com ([217.140.110.172]:33992 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbhEFM3a (ORCPT ); Thu, 6 May 2021 08:29:30 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6BBD6106F; Thu, 6 May 2021 05:28:32 -0700 (PDT) Received: from ubiquitous (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A18363F73B; Thu, 6 May 2021 05:28:30 -0700 (PDT) Date: Thu, 6 May 2021 12:28:23 +0000 From: Vincent Donnefort To: Xuewen Yan Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, zhang.lyra@gmail.com, xuewyan@foxmail.com Subject: Re: [PATCH] sched/pelt: Add UTIL_AVG_UNCHANGED flag for last_enqueued_diff Message-ID: <20210506122823.GA8671@ubiquitous> References: <20210506110936.8797-1-xuewen.yan94@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210506110936.8797-1-xuewen.yan94@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 06, 2021 at 07:09:36PM +0800, Xuewen Yan wrote: > From: Xuewen Yan > > The UTIL_AVG_UNCHANGED flag had been cleared when the task util changed. > And the enqueued is equal to task_util with the flag, so it is better > to add the UTIL_AVG_UNCHANGED flag for last_enqueued_diff. > > Fixes: b89997aa88f0b sched/pelt: Fix task util_est update filtering > > Signed-off-by: Xuewen Yan > --- > kernel/sched/fair.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index e5e457fa9dc8..94d77b4fa601 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -3996,7 +3996,7 @@ static inline void util_est_update(struct cfs_rq *cfs_rq, > if (ue.enqueued & UTIL_AVG_UNCHANGED) > return; > > - last_enqueued_diff = ue.enqueued; > + last_enqueued_diff = (ue.enqueued | UTIL_AVG_UNCHANGED); > > /* > * Reset EWMA on utilization increases, the moving average is used only > -- > 2.29.0 > Hi, We do indeed for the diff use the flag for the value updated and no flag for the value before the update. However, last_enqueued_diff is only used for the margin check which is an heuristic and is not an accurate value (~1%) and as we know we already loose the LSB in util_est, I'm not sure this is really necessary. -- Vincent