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:   Wed, 12 Sep 2018 21:49:23 -0400
From:   Johannes Weiner <hannes@...xchg.org>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Tejun Heo <tj@...nel.org>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Daniel Drake <drake@...lessm.com>,
        Vinayak Menon <vinmenon@...eaurora.org>,
        Christopher Lameter <cl@...ux.com>,
        Peter Enderborg <peter.enderborg@...y.com>,
        Shakeel Butt <shakeelb@...gle.com>,
        Mike Galbraith <efault@....de>, linux-mm@...ck.org,
        cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-team@...com
Subject: Re: [PATCH 4/9] sched: loadavg: consolidate LOAD_INT, LOAD_FRAC,
 CALC_LOAD

On Wed, Sep 12, 2018 at 04:28:28PM -0700, Andrew Morton wrote:
> On Tue, 28 Aug 2018 13:22:53 -0400 Johannes Weiner <hannes@...xchg.org> wrote:
> 
> > There are several definitions of those functions/macros in places that
> > mess with fixed-point load averages. Provide an official version.
> 
> missed blk-iolatency.c for some reason?

Ah, that callsite came in with this merge window. Thanks for the
fixup.

> --- a/block/blk-iolatency.c~sched-loadavg-consolidate-load_int-load_frac-calc_load-fix
> +++ a/block/blk-iolatency.c
> @@ -512,7 +512,7 @@ static void iolatency_check_latencies(st
>  	exp_idx = min_t(int, BLKIOLATENCY_NR_EXP_FACTORS - 1,
>  			div64_u64(iolat->cur_win_nsec,
>  				  BLKIOLATENCY_EXP_BUCKET_SIZE));
> -	CALC_LOAD(iolat->lat_avg, iolatency_exp_factors[exp_idx], stat.mean);
> +	calc_load(iolat->lat_avg, iolatency_exp_factors[exp_idx], stat.mean);

The macro used to modify the avg parameter in place, but with the
function we need an explicit assignment to update the variable:

Signed-off-by: Johannes Weiner <hannes@...xchg.org>
---

diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
index 335c22317757..8793f1344e11 100644
--- a/block/blk-iolatency.c
+++ b/block/blk-iolatency.c
@@ -512,7 +512,8 @@ static void iolatency_check_latencies(struct iolatency_grp *iolat, u64 now)
 	exp_idx = min_t(int, BLKIOLATENCY_NR_EXP_FACTORS - 1,
 			div64_u64(iolat->cur_win_nsec,
 				  BLKIOLATENCY_EXP_BUCKET_SIZE));
-	calc_load(iolat->lat_avg, iolatency_exp_factors[exp_idx], stat.mean);
+	iolat->lat_avg = calc_load(iolat->lat_avg,
+				   iolatency_exp_factors[exp_idx], stat.mean);
 
 	/* Everything is ok and we don't need to adjust the scale. */
 	if (stat.mean <= iolat->min_lat_nsec &&

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ