From patchwork Fri Apr 26 00:20:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 10917859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D75F4912 for ; Fri, 26 Apr 2019 00:21:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7A7528CFB for ; Fri, 26 Apr 2019 00:21:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB2E728D36; Fri, 26 Apr 2019 00:21:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6777128D55 for ; Fri, 26 Apr 2019 00:21:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727284AbfDZAVR (ORCPT ); Thu, 25 Apr 2019 20:21:17 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:42221 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbfDZAVR (ORCPT ); Thu, 25 Apr 2019 20:21:17 -0400 Received: by mail-yw1-f65.google.com with SMTP id y131so565597ywa.9 for ; Thu, 25 Apr 2019 17:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AcZ92YH0X8djThbWKLrf0MusGXZCJVm/wjWNJQyN0zw=; b=Pt5+uZZMse7LoMU02YGfkh4V6NNM64zWc5jb9uFADxiyv+MhXQSeea4tJhtJ6ateIU TjfIQ6AUYy80Fv714H8biQFs+ucUtcbeBPvuz1MywCKx4dsOPMz4uC3V9ieyDXvmz1Sn h5phx3a+1q72UokLDxMmnSrrL2lch65anF6vhF3VoMkSdfPx6vg6mgQobLFVap7mUjIo 57OC4A9R7JSvnbRZrNfEKM4TglkzXhq6bj5n9qa7EBfUhqtJ5VUOVaFcbkzO2LJoaFNS spF38xpGDA7T22sds3WQJssi3Z3sars1obRiC9DlffwiSN59xy/51ce9t6Xx9ffLchI0 5S6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AcZ92YH0X8djThbWKLrf0MusGXZCJVm/wjWNJQyN0zw=; b=jlIhG8Au3h83Q1mEsTXad6dO8xyyVWs7qlYWIIa2GaO+uI8g8+FtJMFS6t0i+F1Dr4 kTCItKNGrpfWwgtYcmrQwQMtS+ZC5bhYX9/E1Jc/rmgYuQZV5DHrz9DzVBsIGzVrYi/q 8o9pVTGe+auy+3PUImw0L5nl5HQ3pI0r1F2Cg4pRJirTw5FltEAU1rYbe2DmEwjHxTj+ 2KV8fkCAg8DGnRviiIQ+dk4AG5Pg5TnMjOEY5RCE6ngOCJmZjlALTL+kDBNjWlrgcAjL mOIanYvfhN9X6YXkbfvmtfaJIqA/1o4TciDTMitoDeAichpnBEwt6AJkcZClBHi+aJ6v +Yyw== X-Gm-Message-State: APjAAAXbwfUpKgwFEtD6rl5oHZG4eMvcovcGx3cwSoDK0p5vuoX2ghcK A13ucOFDHqEyh7iGiZVcdl3eCDr7 X-Google-Smtp-Source: APXvYqzqvHdaCYxCvoGRQIvKuzAd5308rO5l0Ekt+Tuq+WnwjTRHY+VJG9ytl+Uiqfq5csIFwXYFOw== X-Received: by 2002:a81:4cd5:: with SMTP id z204mr13469334ywa.318.1556238076159; Thu, 25 Apr 2019 17:21:16 -0700 (PDT) Received: from localhost ([2620:10d:c091:180::5484]) by smtp.gmail.com with ESMTPSA id 193sm8022184ywf.22.2019.04.25.17.21.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 17:21:15 -0700 (PDT) From: Jes Sorensen X-Google-Original-From: Jes Sorensen To: linux-block@vger.kernel.org Cc: josef@toxicpanda.com, kernel-team@fb.com Subject: [PATCH 1/5] blk-stat: rename batch to time Date: Thu, 25 Apr 2019 20:20:46 -0400 Message-Id: <20190426002050.15499-2-Jes.Sorensen@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190426002050.15499-1-Jes.Sorensen@gmail.com> References: <20190426002050.15499-1-Jes.Sorensen@gmail.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Bacik Batch isn't at all related to what it's actually used for, which is the running sum of time spent doing IO. Rename it to time so it makes logical sense. Signed-off-by: Josef Bacik --- block/blk-stat.c | 6 +++--- include/linux/blk_types.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blk-stat.c b/block/blk-stat.c index 696a04176e4d..8a40ac719ba7 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -21,7 +21,7 @@ void blk_rq_stat_init(struct blk_rq_stat *stat) { stat->min = -1ULL; stat->max = stat->nr_samples = stat->mean = 0; - stat->batch = 0; + stat->time = 0; } /* src is a per-cpu stat, mean isn't initialized */ @@ -33,7 +33,7 @@ void blk_rq_stat_sum(struct blk_rq_stat *dst, struct blk_rq_stat *src) dst->min = min(dst->min, src->min); dst->max = max(dst->max, src->max); - dst->mean = div_u64(src->batch + dst->mean * dst->nr_samples, + dst->mean = div_u64(src->time + dst->mean * dst->nr_samples, dst->nr_samples + src->nr_samples); dst->nr_samples += src->nr_samples; @@ -43,7 +43,7 @@ void blk_rq_stat_add(struct blk_rq_stat *stat, u64 value) { stat->min = min(stat->min, value); stat->max = max(stat->max, value); - stat->batch += value; + stat->time += value; stat->nr_samples++; } diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 791fee35df88..df24baf455c2 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -446,7 +446,7 @@ struct blk_rq_stat { u64 min; u64 max; u32 nr_samples; - u64 batch; + u64 time; }; #endif /* __LINUX_BLK_TYPES_H */