lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 6 May 2021 12:28:23 +0000
From:   Vincent Donnefort <vincent.donnefort@....com>
To:     Xuewen Yan <xuewen.yan94@...il.com>
Cc:     mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, linux-kernel@...r.kernel.org,
        zhang.lyra@...il.com, xuewyan@...mail.com
Subject: Re: [PATCH] sched/pelt: Add UTIL_AVG_UNCHANGED flag for
 last_enqueued_diff

On Thu, May 06, 2021 at 07:09:36PM +0800, Xuewen Yan wrote:
> From: Xuewen Yan <xuewen.yan@...soc.com>
> 
> 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 <xuewen.yan@...soc.com>
> ---
>  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ