Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6090738imm; Wed, 12 Sep 2018 16:30:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ7NaP7LXMgVAd9RtAViCpW6QKoW85ehCTDhB6fx8w/blYqCL3PrJijnzAU2vOrNjcqROIL X-Received: by 2002:a62:c60e:: with SMTP id m14-v6mr4743114pfg.40.1536795034982; Wed, 12 Sep 2018 16:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536795034; cv=none; d=google.com; s=arc-20160816; b=lsD6oRcEL26L4ZHe6ZMPSq1eOGK291tu1c5Lk+F3cb0oZiCdyVja25gfAv4vlzgCOZ MSYMqCvJQl+yP8mqDo4EjlrECbRCno3wGPGLRK1/Y0cO+ZMhhcy+VdkGJ7GlwcCWluTG j0NTXr9NtojvZiCIdsC8xLRNb5UshfX64tfSqVJq6ure4RtIukpiTsvPL4KXtLa3Q0En BFmLSQi4NodedQBAr+Di46nJ1BCGf0eHCExzZx8HpiqSA+bBtAiHIR6jM5Pc7h59dwYt jXfV+6hVF5QUVWcaNMVN9t6L3hRrRqX3Khy0d8kq55koXHLHrCtbsHE7Cg1QLR2UFKCV AoNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=S8xENUfF4syyoED0BxkODRrFWoF+U9seL+QAZc/Pi5A=; b=aE58G/mA2TD2ASI9+DJ7KmHnewS42R/NRKnzTQUS+UBNcYJKa3yFy0dhnwd57IrRP0 H9g48xuX7ENakk6z2VYhMl6M4FTMs/suY6N8eZljzrkW/IjlI3v+RH40CfqQPRhd1SJG x08gYO/odO78Tsw0gQ4levxK9FLHFHmyWu1rh7ZIxV2ByRgMsV/reN+j4O9ENflbhbHD MRGz1PoCIbhzd0jvVfrBnhNzDHORV8R9FvzpM7IcFGYkZr6m7RLbrw3+xtqPgKWgXo7X oo+NJEt3o7gJAfeY6vA1+5L+uG47GfCuSGf4lXUqJmGg8VI+PRjDmyS6OSaui0qgQLuJ EdFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o21-v6si2463920pgk.337.2018.09.12.16.30.18; Wed, 12 Sep 2018 16:30:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728029AbeIMEfQ (ORCPT + 99 others); Thu, 13 Sep 2018 00:35:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56986 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbeIMEfP (ORCPT ); Thu, 13 Sep 2018 00:35:15 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7E741D10; Wed, 12 Sep 2018 23:28:29 +0000 (UTC) Date: Wed, 12 Sep 2018 16:28:28 -0700 From: Andrew Morton To: Johannes Weiner Cc: Ingo Molnar , Peter Zijlstra , Linus Torvalds , Tejun Heo , Suren Baghdasaryan , Daniel Drake , Vinayak Menon , Christopher Lameter , Peter Enderborg , Shakeel Butt , Mike Galbraith , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 4/9] sched: loadavg: consolidate LOAD_INT, LOAD_FRAC, CALC_LOAD Message-Id: <20180912162828.ae336d83e8c467345e70de17@linux-foundation.org> In-Reply-To: <20180828172258.3185-5-hannes@cmpxchg.org> References: <20180828172258.3185-1-hannes@cmpxchg.org> <20180828172258.3185-5-hannes@cmpxchg.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Aug 2018 13:22:53 -0400 Johannes Weiner 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? --- a/block/blk-iolatency.c~sched-loadavg-consolidate-load_int-load_frac-calc_load-fix +++ a/block/blk-iolatency.c @@ -139,7 +139,7 @@ struct iolatency_grp { #define BLKIOLATENCY_MAX_WIN_SIZE NSEC_PER_SEC /* * These are the constants used to fake the fixed-point moving average - * calculation just like load average. The call to CALC_LOAD folds + * calculation just like load average. The call to calc_load() folds * (FIXED_1 (2048) - exp_factor) * new_sample into lat_avg. The sampling * window size is bucketed to try to approximately calculate average * latency such that 1/exp (decay rate) is [1 min, 2.5 min) when windows @@ -503,7 +503,7 @@ static void iolatency_check_latencies(st lat_info = &parent->child_lat; /* - * CALC_LOAD takes in a number stored in fixed point representation. + * calc_load() takes in a number stored in fixed point representation. * Because we are using this for IO time in ns, the values stored * are significantly larger than the FIXED_1 denominator (2048). * Therefore, rounding errors in the calculation are negligible and @@ -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); /* Everything is ok and we don't need to adjust the scale. */ if (stat.mean <= iolat->min_lat_nsec && _