From patchwork Wed Jul 8 07:58:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoqing Jiang X-Patchwork-Id: 11650965 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABADD739 for ; Wed, 8 Jul 2020 07:59:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9418B20672 for ; Wed, 8 Jul 2020 07:59:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cloud.ionos.com header.i=@cloud.ionos.com header.b="MjUZ6RHW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbgGHH72 (ORCPT ); Wed, 8 Jul 2020 03:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgGHH72 (ORCPT ); Wed, 8 Jul 2020 03:59:28 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 173F4C08C5DC for ; Wed, 8 Jul 2020 00:59:28 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id dg28so40856469edb.3 for ; Wed, 08 Jul 2020 00:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DRUCw0m6MRFHAU9r2+IyC0j6NTzZrJ1siX12KTm+zWI=; b=MjUZ6RHWFN55P93dC82a9yD/gjsPUUjaFLqxknsxkFpTs8HUh20479lW2XamPoR2FI OtOVMSWPdbYgDABJ9lHKTu3pYj2UUmELnmimyBxxdcXY0LFB4snFdrNDogrrRetmh6Fe JghgMXENwj03syxYJWwSQ9CI/5GGE+mf+5WGlyYbCrn02wtQrji+i/brZCNmAB5AWIet KkIJvn74qhfXbFzCsceTSJJacji/39LyPK7pacIdyzxKGVVrjk0WCigcjRxEDlZNvT6V exufTaYVxHN5XXo8/FUKaXd0LXjRgCrt4q1PUDT/ROgs7ZYbcQj+hbjtYWhNIZi4jFD9 G55A== 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; bh=DRUCw0m6MRFHAU9r2+IyC0j6NTzZrJ1siX12KTm+zWI=; b=B+CZyY954pnoN4sQ52PxDjOsAjp+T1GbrtyECScUkXMyUBvnCqXJ9AvtUUxuJJiddw mUrkQQ5E19D6qS1dECuwGNAgYmUHsjAfQlJ2TakwwMeCFjMVSz/4MVJ9MQAf0B3kGByh pf1rPsqrIRJ626oYCEN4gX//8C/16jB+lmu94jWhii6xDaWjnSwv9L94MovCLBM8PRZz CsaFncBpvK/cTDzr3PQksePxpnT/JfTONalazfl3NPX4bKJWzB0DlbZq7HH/uPnzno2G iX1PAy8CwHWcwiQp2jmM74+suIEKlFCntKZOF0LdWha9tQ+RJftmLZHmTUfLuEBrR8eN 22iQ== X-Gm-Message-State: AOAM5331tXLOaz0uUEFer1R9/UZbWo91Ntl+76HBFjT8BV7Me9cez8Q0 IK91d4BeByiWs3irw2aD4iWn2w== X-Google-Smtp-Source: ABdhPJxkMrsHApw1fbNKnhEuScHZRG4PeWDQhTjeiQpB/JNKtnI/dZJGvSbDOmxWcYbABwjNHoftJQ== X-Received: by 2002:a05:6402:1a54:: with SMTP id bf20mr65053241edb.69.1594195166763; Wed, 08 Jul 2020 00:59:26 -0700 (PDT) Received: from ls00508.pb.local ([2001:1438:4010:2540:b161:f409:fd1d:3a1f]) by smtp.gmail.com with ESMTPSA id mj22sm1570858ejb.118.2020.07.08.00.59.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 00:59:26 -0700 (PDT) From: Guoqing Jiang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, Guoqing Jiang , Philipp Reisner , Lars Ellenberg , drbd-dev@lists.linbit.com Subject: [PATCH RFC 1/5] block: return ns precision from disk_start_io_acct Date: Wed, 8 Jul 2020 09:58:15 +0200 Message-Id: <20200708075819.4531-2-guoqing.jiang@cloud.ionos.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> References: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Currently the duration accounting of bio based driver is converted from jiffies to ns, means it could be less accurate as request based driver. So let disk_start_io_acct return from ns precision, instead of convert jiffies to ns in disk_end_io_acct. Cc: Philipp Reisner Cc: Lars Ellenberg Cc: drbd-dev@lists.linbit.com Signed-off-by: Guoqing Jiang --- block/blk-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index d9d632639bd1..0e806a8c62fb 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1466,6 +1466,7 @@ unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors, struct hd_struct *part = &disk->part0; const int sgrp = op_stat_group(op); unsigned long now = READ_ONCE(jiffies); + unsigned long start_ns = ktime_get_ns(); part_stat_lock(); update_io_ticks(part, now, false); @@ -1474,7 +1475,7 @@ unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors, part_stat_local_inc(part, in_flight[op_is_write(op)]); part_stat_unlock(); - return now; + return start_ns; } EXPORT_SYMBOL(disk_start_io_acct); @@ -1484,11 +1485,11 @@ void disk_end_io_acct(struct gendisk *disk, unsigned int op, struct hd_struct *part = &disk->part0; const int sgrp = op_stat_group(op); unsigned long now = READ_ONCE(jiffies); - unsigned long duration = now - start_time; + unsigned long duration = ktime_get_ns() - start_time; part_stat_lock(); update_io_ticks(part, now, true); - part_stat_add(part, nsecs[sgrp], jiffies_to_nsecs(duration)); + part_stat_add(part, nsecs[sgrp], duration); part_stat_local_dec(part, in_flight[op_is_write(op)]); part_stat_unlock(); } From patchwork Wed Jul 8 07:58:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoqing Jiang X-Patchwork-Id: 11650967 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9543A739 for ; Wed, 8 Jul 2020 07:59:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DA312067D for ; Wed, 8 Jul 2020 07:59:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cloud.ionos.com header.i=@cloud.ionos.com header.b="Y4FjnqkA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbgGHH7a (ORCPT ); Wed, 8 Jul 2020 03:59:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgGHH73 (ORCPT ); Wed, 8 Jul 2020 03:59:29 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E4E5C08C5DC for ; Wed, 8 Jul 2020 00:59:29 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id dg28so40856508edb.3 for ; Wed, 08 Jul 2020 00:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=d1La/axhT/8d5t9Aiud14eTBdaZWaa7PgEVZl8V6a7I=; b=Y4FjnqkAa3dAXCGTBn4aKdECC3vAa4sYo1/cDYBmmbSTpZ/YDuIL33IS4GCNQeMc4X fYjFEql0UQuN/iocsdDsGOH5wGLIjpUy1hyWyFwqc8mqMWmUFhlgrlbtsquAam+Udxec qKGxL6LQXUDzhk9fi0wKcKcXEb8Ot2BWPLegN+EckKh2YPbZy/1WLwJ5WRF/xPsBVjbi 8Aj6l+rKV8kdSQ87iZ5SQCfLsTVQoEaRheEWw4v9ykgc9raZwU9lHJeXQfCTOPnb6R5r b6femXPdiKKp+tKYyLBOd9histw5KzSMzJXAKRYvs6lJykvNYT04IrHn2Ngw0ee4IKh8 FlAQ== 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; bh=d1La/axhT/8d5t9Aiud14eTBdaZWaa7PgEVZl8V6a7I=; b=SNPjx6st9GWO0a74zkfdmt+0ChEtrtN+vC1KYBBNX40y3aVxD+BAPVxbUrxqM9UnBO T8zX5qBQM8GbF1nhI0oAW7VFvykzS7v/fE2NryB+1Ou90zzU0YRKs4ZbX1tVVI54x6/A OyhUr+z10IF0qBCRNXBtXtOHD5nubPlm4afposnfiugZQXt3ts9QHcU5ZRz1DcJ9rKFO laaAoEYz4Lb+Z5Nxx4zzX0Rf4F16Khajb4KweCY6Cbn08wxdQOEr79r8gAlGqiAxa1x8 H5LLTJxoG2bsgwquBafhg4auJSFHwz9HH9msbVh7PZDCKHiGZzYwbSYpR33anRADCigO OzXQ== X-Gm-Message-State: AOAM533ip5S2SoYWt1urSja9BAZme/8X0Qzty1FsCPzk3e/Xy9S5iA3A 82l6FZC4pU+aiirx7M3+gxRHAw== X-Google-Smtp-Source: ABdhPJy2Jb+wDl/LMTi0wrDGkP0jOSRoR3G+rxq7VueNcnI68JbJFWmNFwLIr6Ow3Xr+mVc99qtAgg== X-Received: by 2002:a50:a451:: with SMTP id v17mr46534548edb.256.1594195167995; Wed, 08 Jul 2020 00:59:27 -0700 (PDT) Received: from ls00508.pb.local ([2001:1438:4010:2540:b161:f409:fd1d:3a1f]) by smtp.gmail.com with ESMTPSA id mj22sm1570858ejb.118.2020.07.08.00.59.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 00:59:27 -0700 (PDT) From: Guoqing Jiang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, Guoqing Jiang , Philipp Reisner , Lars Ellenberg , drbd-dev@lists.linbit.com Subject: [PATCH RFC 2/5] drbd: remove unused argument from drbd_request_prepare and __drbd_make_request Date: Wed, 8 Jul 2020 09:58:16 +0200 Message-Id: <20200708075819.4531-3-guoqing.jiang@cloud.ionos.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> References: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org We can remove start_jif since it is not used by drbd_request_prepare, then remove it from __drbd_make_request further. Cc: Philipp Reisner Cc: Lars Ellenberg Cc: drbd-dev@lists.linbit.com Signed-off-by: Guoqing Jiang --- This had been sent before, now it is better to include it in the thread. https://marc.info/?l=linux-block&m=159369644305325&w=2 drivers/block/drbd/drbd_int.h | 2 +- drivers/block/drbd/drbd_main.c | 3 +-- drivers/block/drbd/drbd_req.c | 11 ++++------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index fe6cb99eb917..aacd2010b555 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -1450,7 +1450,7 @@ extern void conn_free_crypto(struct drbd_connection *connection); /* drbd_req */ extern void do_submit(struct work_struct *ws); -extern void __drbd_make_request(struct drbd_device *, struct bio *, unsigned long); +extern void __drbd_make_request(struct drbd_device *, struct bio *); extern blk_qc_t drbd_submit_bio(struct bio *bio); extern int drbd_read_remote(struct drbd_device *device, struct drbd_request *req); extern int is_valid_ar_handle(struct drbd_request *, sector_t); diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 7c34cc0ad8cc..42f2a235417c 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2293,7 +2293,6 @@ static void do_retry(struct work_struct *ws) list_for_each_entry_safe(req, tmp, &writes, tl_requests) { struct drbd_device *device = req->device; struct bio *bio = req->master_bio; - unsigned long start_jif = req->start_jif; bool expected; expected = @@ -2328,7 +2327,7 @@ static void do_retry(struct work_struct *ws) /* We are not just doing submit_bio_noacct(), * as we want to keep the start_time information. */ inc_ap_bio(device); - __drbd_make_request(device, bio, start_jif); + __drbd_make_request(device, bio); } } diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 674be09b2da9..f705128b4f27 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -1188,7 +1188,7 @@ static void drbd_queue_write(struct drbd_device *device, struct drbd_request *re * Returns ERR_PTR(-ENOMEM) if we cannot allocate a drbd_request. */ static struct drbd_request * -drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long start_jif) +drbd_request_prepare(struct drbd_device *device, struct bio *bio) { const int rw = bio_data_dir(bio); struct drbd_request *req; @@ -1416,9 +1416,9 @@ static void drbd_send_and_submit(struct drbd_device *device, struct drbd_request complete_master_bio(device, &m); } -void __drbd_make_request(struct drbd_device *device, struct bio *bio, unsigned long start_jif) +void __drbd_make_request(struct drbd_device *device, struct bio *bio) { - struct drbd_request *req = drbd_request_prepare(device, bio, start_jif); + struct drbd_request *req = drbd_request_prepare(device, bio); if (IS_ERR_OR_NULL(req)) return; drbd_send_and_submit(device, req); @@ -1596,19 +1596,16 @@ void do_submit(struct work_struct *ws) blk_qc_t drbd_submit_bio(struct bio *bio) { struct drbd_device *device = bio->bi_disk->private_data; - unsigned long start_jif; blk_queue_split(&bio); - start_jif = jiffies; - /* * what we "blindly" assume: */ D_ASSERT(device, IS_ALIGNED(bio->bi_iter.bi_size, 512)); inc_ap_bio(device); - __drbd_make_request(device, bio, start_jif); + __drbd_make_request(device, bio); return BLK_QC_T_NONE; } From patchwork Wed Jul 8 07:58:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoqing Jiang X-Patchwork-Id: 11650969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CFE3813B4 for ; Wed, 8 Jul 2020 07:59:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B43AA20739 for ; Wed, 8 Jul 2020 07:59:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cloud.ionos.com header.i=@cloud.ionos.com header.b="RmG9H1oO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726935AbgGHH7b (ORCPT ); Wed, 8 Jul 2020 03:59:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgGHH7a (ORCPT ); Wed, 8 Jul 2020 03:59:30 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28201C08C5DC for ; Wed, 8 Jul 2020 00:59:30 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id dr13so49373586ejc.3 for ; Wed, 08 Jul 2020 00:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nrkWmuZbynTCM3f/uot82ff2fO71eir9goNysLeUz2E=; b=RmG9H1oOSBSNGo/T97+ya0G6yXyZCmXTHIM5aehQxamWs383yIiZwJwxh1HQ5CBeZ1 CJi8BrLTX811AbY9Zs8DeWluHXXr4bU38RzynkigS48Iyvi1jAL7/mw4cyfxhnndvh/d zUKyKi9fenPYcENkF6Mdp+C+msaO/UhkX2fCmX0mkgna6dJirzRdWIQh++fMYZtvC9bz BH+dpgtvsp77UI1Q03opUrXhKiAxfWlT7O5xqGr54m2LYYyM3tU+3da8ucXl0WKlZdDF HJWBEPfykY+uWmBSJS55PI+1P2GI0Zcc2QaQeCBg9VRuGlnGf7O6tgAiLufHGcAZkpwn RfLg== 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; bh=nrkWmuZbynTCM3f/uot82ff2fO71eir9goNysLeUz2E=; b=b/UwuMdJYE2c2BoKpeIXR2RDiwrRCHuQk8LNbCGTMXfxBrGxE4Ib5p3PQwHN2/o8Fl Hca9TYPrI1hjGevUogOcUeeRs6S1xsrJ8jGcTgGEt3NwFHFpxeVepfv0Djn/1hWm/M9g qq45hHKgPdkDQZMMHx2MmrHFhcS6hH91cO7zPub1xq8djfBAb1keEORNSyUl2LLMMuXF X+CJBU7c9kQ1u6RjIyCVboG70cJFPb7/om7Eh9vyLiP8UQ+BJFXQXETMVWGgYnmZQX/e Q+c1lLruMMLsFRGbIAnND5hFnpiYg5dGnrnotFh/kHsJsJ50EPSx4H8xqQMTysAqUYf2 bzUw== X-Gm-Message-State: AOAM532vr7oAxlMEtlL+67e4pVIaK97rxIVAsId0PmSxFHgBV8EeLY0s 9e1RTSDeZupwVcDSQqZ8/cbzfQ== X-Google-Smtp-Source: ABdhPJz6fQHh44FVZ3nYKLo4pWFQDwYG6Ttpq89pfgkJ/Nb927v0oE90LAToh58TazOdqFHlL/u6Wg== X-Received: by 2002:a17:906:7802:: with SMTP id u2mr52350656ejm.478.1594195168913; Wed, 08 Jul 2020 00:59:28 -0700 (PDT) Received: from ls00508.pb.local ([2001:1438:4010:2540:b161:f409:fd1d:3a1f]) by smtp.gmail.com with ESMTPSA id mj22sm1570858ejb.118.2020.07.08.00.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 00:59:28 -0700 (PDT) From: Guoqing Jiang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, Guoqing Jiang , Philipp Reisner , Lars Ellenberg , drbd-dev@lists.linbit.com Subject: [PATCH RFC 3/5] drbd: rename start_jif to start_ns Date: Wed, 8 Jul 2020 09:58:17 +0200 Message-Id: <20200708075819.4531-4-guoqing.jiang@cloud.ionos.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> References: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Let's rename start_jif to start_ns to reflect that bio_start_io_acct returns ns presicion now. Cc: Philipp Reisner Cc: Lars Ellenberg Cc: drbd-dev@lists.linbit.com Signed-off-by: Guoqing Jiang --- drivers/block/drbd/drbd_debugfs.c | 8 ++++---- drivers/block/drbd/drbd_int.h | 2 +- drivers/block/drbd/drbd_req.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/block/drbd/drbd_debugfs.c b/drivers/block/drbd/drbd_debugfs.c index b3b9cd5628fd..672fd7e6587d 100644 --- a/drivers/block/drbd/drbd_debugfs.c +++ b/drivers/block/drbd/drbd_debugfs.c @@ -105,7 +105,7 @@ static void seq_print_one_request(struct seq_file *m, struct drbd_request *req, (s & RQ_WRITE) ? "W" : "R"); #define RQ_HDR_2 "\tstart\tin AL\tsubmit" - seq_printf(m, "\t%d", jiffies_to_msecs(now - req->start_jif)); + seq_printf(m, "\t%llu", (ktime_get_ns() - req->start_ns) / NSEC_PER_MSEC); seq_print_age_or_dash(m, s & RQ_IN_ACT_LOG, now - req->in_actlog_jif); seq_print_age_or_dash(m, s & RQ_LOCAL_PENDING, now - req->pre_submit_jif); @@ -161,7 +161,7 @@ static void seq_print_waiting_for_AL(struct seq_file *m, struct drbd_resource *r seq_puts(m, "minor\tvnr\tage\t#waiting\n"); rcu_read_lock(); idr_for_each_entry(&resource->devices, device, i) { - unsigned long jif; + unsigned long ns; struct drbd_request *req; int n = atomic_read(&device->ap_actlog_cnt); if (n) { @@ -171,7 +171,7 @@ static void seq_print_waiting_for_AL(struct seq_file *m, struct drbd_resource *r /* if the oldest request does not wait for the activity log * it is not interesting for us here */ if (req && !(req->rq_state & RQ_IN_ACT_LOG)) - jif = req->start_jif; + ns = req->start_ns; else req = NULL; spin_unlock_irq(&device->resource->req_lock); @@ -179,7 +179,7 @@ static void seq_print_waiting_for_AL(struct seq_file *m, struct drbd_resource *r if (n) { seq_printf(m, "%u\t%u\t", device->minor, device->vnr); if (req) - seq_printf(m, "%u\t", jiffies_to_msecs(now - jif)); + seq_printf(m, "%llu\t", (ktime_get_ns() - ns) / NSEC_PER_MSEC); else seq_puts(m, "-\t"); seq_printf(m, "%u\n", n); diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index aacd2010b555..467d96316230 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -301,7 +301,7 @@ struct drbd_request { struct list_head req_pending_local; /* for generic IO accounting */ - unsigned long start_jif; + unsigned long start_ns; /* for DRBD internal statistics */ diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index f705128b4f27..6ad6b4470ebd 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -245,7 +245,7 @@ void drbd_req_complete(struct drbd_request *req, struct bio_and_error *m) start_new_tl_epoch(first_peer_device(device)->connection); /* Update disk stats */ - bio_end_io_acct(req->master_bio, req->start_jif); + bio_end_io_acct(req->master_bio, req->start_ns); /* If READ failed, * have it be pushed back to the retry work queue, @@ -1206,7 +1206,7 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio) } /* Update disk stats */ - req->start_jif = bio_start_io_acct(req->master_bio); + req->start_ns = bio_start_io_acct(req->master_bio); if (!get_ldev(device)) { bio_put(req->private_bio); From patchwork Wed Jul 8 07:58:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoqing Jiang X-Patchwork-Id: 11650971 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9744D13B4 for ; Wed, 8 Jul 2020 07:59:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A1B220739 for ; Wed, 8 Jul 2020 07:59:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cloud.ionos.com header.i=@cloud.ionos.com header.b="PiJN2FK6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbgGHH7c (ORCPT ); Wed, 8 Jul 2020 03:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgGHH7b (ORCPT ); Wed, 8 Jul 2020 03:59:31 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E417C08C5DC for ; Wed, 8 Jul 2020 00:59:31 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id e15so40857961edr.2 for ; Wed, 08 Jul 2020 00:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+fdVmMPaMuEYUAagJU6UlGTtXsN3VBZ222XdaGlwDBk=; b=PiJN2FK6vAbivDgzWfmg0WGjwJBe/IGhPDjYyvAtWXGPHEkJCwep0RgoucpaBPpxox WglV0X4aRDkTq2VYuEfalL5cjTTgf+eV3gsKJ0ZN04sPnVxFpdx5w+WvF8n/haJw/QSX VumYwW4YSiVB1RYhC7AgtL8/nshuwGLhQo1ZCoI+ysIOhlnD36c2lmeuRL+jUT50/gUP pT0z5H7+XXIRE6/u8sacyLn/ZE61kpKP8CxCwpYleyTFrmRSJuVKC4NfaGseDQDbfG0T tOe5tqtl5octDmg2jXKXZEzMbRXBfLUYcELFId8NbqW1Uk0fyvuzGysPqKPjIL5/2zSa QAfQ== 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; bh=+fdVmMPaMuEYUAagJU6UlGTtXsN3VBZ222XdaGlwDBk=; b=NyWZWpMM5L+8a8B0fC2F2HwTP14xir2mYP3GkAQqKx60saYUnozKIOspX53eBclv8X oZXSBsJMJ5qiWbKjKPdiHv3GHb2OsjPCz5ZuVzZz+PfpXj0rB9BkLA9KjL3rNAWB+3hf hYXH8TNTMQ2FyLgdqNQNDPrbgEg0zl4/gFm37yuZ8KJZmriuN5jkDHjkfq6pMNWHA1RW OCsFnHjsC4xAQM+Fjj0c7mVpQcqyvYBjIAxlYttBd7QFCzBwp0H32TlZMcjjNLnPMJSi PS1Ej6A5+Tf4e3Q8XQOpuR7haGVpn6kIlbuyrEIw9QMuQ5Pnnc7m01QlcY6X/g8vyMaY RJzQ== X-Gm-Message-State: AOAM531SL9Lt1cj82qOXeOLFs+Dg5mfBKXvpPswxJF2ydT9SsqreA2sy 5Wp4QpJU1iVq3KMXgZlimRrWUw== X-Google-Smtp-Source: ABdhPJxs6AqMXeeFUeaFL47L+X2Cjx2PKsI1FavylLR2xNVZeda5MC4mQQUd/PqabTiD999JoUOplA== X-Received: by 2002:a05:6402:947:: with SMTP id h7mr65667801edz.213.1594195169786; Wed, 08 Jul 2020 00:59:29 -0700 (PDT) Received: from ls00508.pb.local ([2001:1438:4010:2540:b161:f409:fd1d:3a1f]) by smtp.gmail.com with ESMTPSA id mj22sm1570858ejb.118.2020.07.08.00.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 00:59:29 -0700 (PDT) From: Guoqing Jiang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, Guoqing Jiang , Florian-Ewald Mueller Subject: [PATCH RFC 4/5] block: add a statistic table for io latency Date: Wed, 8 Jul 2020 09:58:18 +0200 Message-Id: <20200708075819.4531-5-guoqing.jiang@cloud.ionos.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> References: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Usually, we get the status of block device by cat stat file, but we can only know the total time with that file. And we would like to know more accurate statistic, such as each latency range, which helps people to diagnose if there is issue about the hardware. Also a new config option is introduced to control if people want to know the additional statistics or not, and we also use the option for io sector in next patch. Signed-off-by: Florian-Ewald Mueller Signed-off-by: Guoqing Jiang --- block/Kconfig | 8 ++++++++ block/blk-core.c | 35 +++++++++++++++++++++++++++++++++++ block/genhd.c | 26 ++++++++++++++++++++++++++ include/linux/part_stat.h | 7 +++++++ 4 files changed, 76 insertions(+) diff --git a/block/Kconfig b/block/Kconfig index 9357d7302398..dba71feaa85b 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -175,6 +175,14 @@ config BLK_DEBUG_FS Unless you are building a kernel for a tiny system, you should say Y here. +config BLK_ADDITIONAL_DISKSTAT + bool "Block layer additional diskstat" + default n + help + Enabling this option adds io latency statistics for each block device. + + If unsure, say N. + config BLK_DEBUG_FS_ZONED bool default BLK_DEBUG_FS && BLK_DEV_ZONED diff --git a/block/blk-core.c b/block/blk-core.c index 0e806a8c62fb..7a129c8f1b23 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1411,6 +1411,39 @@ static void update_io_ticks(struct hd_struct *part, unsigned long now, bool end) } } +#ifdef CONFIG_BLK_ADDITIONAL_DISKSTAT +/* + * Either account additional stat for request if req is not NULL or account for bio. + */ +static void blk_additional_latency(struct hd_struct *part, const int sgrp, + struct request *req, unsigned long start_ns) +{ + unsigned int idx; + unsigned long duration, now = ktime_get_ns(); + + if (req) + duration = (now - req->start_time_ns) / NSEC_PER_MSEC; + else + duration = (now - start_ns) / NSEC_PER_MSEC; + + duration /= HZ_TO_MSEC_NUM; + if (likely(duration > 0)) { + idx = ilog2(duration); + if (idx > ADD_STAT_NUM - 1) + idx = ADD_STAT_NUM - 1; + } else + idx = 0; + part_stat_inc(part, latency_table[idx][sgrp]); + +} +#else +static void blk_additional_latency(struct hd_struct *part, const int sgrp, + struct request *req, unsigned long start_jiffies) + +{ +} +#endif + static void blk_account_io_completion(struct request *req, unsigned int bytes) { if (req->part && blk_do_io_stat(req)) { @@ -1440,6 +1473,7 @@ void blk_account_io_done(struct request *req, u64 now) part = req->part; update_io_ticks(part, jiffies, true); + blk_additional_latency(part, sgrp, req, 0); part_stat_inc(part, ios[sgrp]); part_stat_add(part, nsecs[sgrp], now - req->start_time_ns); part_stat_unlock(); @@ -1489,6 +1523,7 @@ void disk_end_io_acct(struct gendisk *disk, unsigned int op, part_stat_lock(); update_io_ticks(part, now, true); + blk_additional_latency(part, sgrp, NULL, start_time); part_stat_add(part, nsecs[sgrp], duration); part_stat_local_dec(part, in_flight[op_is_write(op)]); part_stat_unlock(); diff --git a/block/genhd.c b/block/genhd.c index 60ae4e1b4d38..a33937a74fb1 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1420,6 +1420,29 @@ static struct device_attribute dev_attr_fail_timeout = __ATTR(io-timeout-fail, 0644, part_timeout_show, part_timeout_store); #endif +#ifdef CONFIG_BLK_ADDITIONAL_DISKSTAT +static ssize_t io_latency_show(struct device *dev, struct device_attribute *attr, char *buf) +{ + struct hd_struct *p = dev_to_part(dev); + size_t count = 0; + int i, sgrp; + + for (i = 0; i < ADD_STAT_NUM; i++) { + count += scnprintf(buf + count, PAGE_SIZE - count, "%5d ms: ", + (1 << i) * HZ_TO_MSEC_NUM); + for (sgrp = 0; sgrp < NR_STAT_GROUPS; sgrp++) + count += scnprintf(buf + count, PAGE_SIZE - count, "%lu ", + part_stat_read(p, latency_table[i][sgrp])); + count += scnprintf(buf + count, PAGE_SIZE - count, "\n"); + } + + return count; +} + +static struct device_attribute dev_attr_io_latency = + __ATTR(io_latency, 0444, io_latency_show, NULL); +#endif + static struct attribute *disk_attrs[] = { &dev_attr_range.attr, &dev_attr_ext_range.attr, @@ -1438,6 +1461,9 @@ static struct attribute *disk_attrs[] = { #endif #ifdef CONFIG_FAIL_IO_TIMEOUT &dev_attr_fail_timeout.attr, +#endif +#ifdef CONFIG_BLK_ADDITIONAL_DISKSTAT + &dev_attr_io_latency.attr, #endif NULL }; diff --git a/include/linux/part_stat.h b/include/linux/part_stat.h index 24125778ef3e..fe3def8c69d7 100644 --- a/include/linux/part_stat.h +++ b/include/linux/part_stat.h @@ -9,6 +9,13 @@ struct disk_stats { unsigned long sectors[NR_STAT_GROUPS]; unsigned long ios[NR_STAT_GROUPS]; unsigned long merges[NR_STAT_GROUPS]; +#ifdef CONFIG_BLK_ADDITIONAL_DISKSTAT +/* + * We measure latency (ms) for 1, 2, ..., 1024 and >=1024. + */ +#define ADD_STAT_NUM 12 + unsigned long latency_table[ADD_STAT_NUM][NR_STAT_GROUPS]; +#endif unsigned long io_ticks; local_t in_flight[2]; }; From patchwork Wed Jul 8 07:58:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoqing Jiang X-Patchwork-Id: 11650973 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 93A0C739 for ; Wed, 8 Jul 2020 07:59:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BC092067D for ; Wed, 8 Jul 2020 07:59:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cloud.ionos.com header.i=@cloud.ionos.com header.b="CCauQiPf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726973AbgGHH7d (ORCPT ); Wed, 8 Jul 2020 03:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgGHH7c (ORCPT ); Wed, 8 Jul 2020 03:59:32 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2620BC08C5DC for ; Wed, 8 Jul 2020 00:59:32 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id y10so49333618eje.1 for ; Wed, 08 Jul 2020 00:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HGL0/NjRqg+TuE5uhO+UupwMyr96BY1LZWkXHNAnP38=; b=CCauQiPfdITyCagQ1hYwZjmZaaNACw+SWRTmKfygoY8EFTbq79cXhsFXL9B5rcY94I bu7c4XzYRRKsx0w8QapyZHAgk7wF8nuWKlJyC3UzmuJAk1+zWKPNgdUYtqZeLvH62Blz TV0Jr9xFW302Kp88TX6ValS4JJsr3bERSK9h+JXWy6K3OjJtaOgkaEWElWzMSuOdhXZM 3N4grvm7lYiPiaEB2C1wivG9lBumi1dMop3Gkk0Za4cu2iI8uMLupPzQHgPOtN5nh7YT fepUlNigr9t5i5EtTkLjeIAGllKTo4DKby30nYe32dVSd/Kj4lq90MifM1Q3GBMFo7MT 1x1g== 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; bh=HGL0/NjRqg+TuE5uhO+UupwMyr96BY1LZWkXHNAnP38=; b=h8v1Ig1A1xV4zwaULBgp0IfTg1d0TIDS3/UmG8iO1MzCWNb7NX8MDorq9Q/2luERM/ ytuA8EUx0ZE7FxYK1jBJ1G4teyI5wMsrmZa2fmVr3ca26pi5VP9rJJRi648FPs7/cuvV 8Pej2XWmPUpFtG1oqUWjTlJXKa8eyEYLUk/ClsEtverTINi3neQ6fu/1S+GDnaumTFIZ yp9K3e3i3yc2dWBoPaMPVQ75XodhdAwCu2GYLruslfmIjnXS2pQ7JbWf+dy5Ngw4WfCx gwMl2lsXRBizzDBzhyDpcS5ZnQHt2IL/PMWrjGa9RgKsGFd+gWfCCTx+PxS6T9mcW707 Yx7g== X-Gm-Message-State: AOAM533ksQ03NK/raql9QYcEkLm5FixvDYLiEGc9W3AbE56UNg5g/uaA 4zeMVZHVQKo3OatERIxIajrtlQ== X-Google-Smtp-Source: ABdhPJwI0L3xl+LgGFaxJoeDGCtyVV2OTvtGjQRz/nNeY2dTej8cVOX8I27nxckXm3VRWvhD7DLuYA== X-Received: by 2002:a17:906:7005:: with SMTP id n5mr32139970ejj.130.1594195170860; Wed, 08 Jul 2020 00:59:30 -0700 (PDT) Received: from ls00508.pb.local ([2001:1438:4010:2540:b161:f409:fd1d:3a1f]) by smtp.gmail.com with ESMTPSA id mj22sm1570858ejb.118.2020.07.08.00.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 00:59:30 -0700 (PDT) From: Guoqing Jiang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, Guoqing Jiang , Florian-Ewald Mueller Subject: [PATCH RFC 5/5] block: add a statistic table for io sector Date: Wed, 8 Jul 2020 09:58:19 +0200 Message-Id: <20200708075819.4531-6-guoqing.jiang@cloud.ionos.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> References: <20200708075819.4531-1-guoqing.jiang@cloud.ionos.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org With the sector table, so we can know the distribution of different IO size from upper layer, which means we could have the opportunity to tune the performance based on the mostly issued IOs. Signed-off-by: Florian-Ewald Mueller Signed-off-by: Guoqing Jiang --- block/Kconfig | 3 ++- block/blk-core.c | 19 +++++++++++++++++++ block/genhd.c | 21 +++++++++++++++++++++ include/linux/part_stat.h | 3 ++- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/block/Kconfig b/block/Kconfig index dba71feaa85b..f1c4800969ef 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -179,7 +179,8 @@ config BLK_ADDITIONAL_DISKSTAT bool "Block layer additional diskstat" default n help - Enabling this option adds io latency statistics for each block device. + Enabling this option adds io latency and io size statistics for each + block device. If unsure, say N. diff --git a/block/blk-core.c b/block/blk-core.c index 7a129c8f1b23..d3c9f727926f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1436,12 +1436,29 @@ static void blk_additional_latency(struct hd_struct *part, const int sgrp, part_stat_inc(part, latency_table[idx][sgrp]); } + +static void blk_additional_sector(struct hd_struct *part, const int sgrp, + unsigned int sectors) +{ + unsigned int KB, idx; + + KB = sectors / 2; + idx = (KB > 0) ? ilog2(KB) : 0; + + idx = (idx > (ADD_STAT_NUM - 1)) ? (ADD_STAT_NUM - 1) : idx; + part_stat_inc(part, size_table[idx][sgrp]); +} #else static void blk_additional_latency(struct hd_struct *part, const int sgrp, struct request *req, unsigned long start_jiffies) { } + +static void blk_additional_sector(struct hd_struct *part, const int sgrp, + unsigned int sectors) +{ +} #endif static void blk_account_io_completion(struct request *req, unsigned int bytes) @@ -1452,6 +1469,7 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes) part_stat_lock(); part = req->part; + blk_additional_sector(part, sgrp, bytes >> SECTOR_SHIFT); part_stat_add(part, sectors[sgrp], bytes >> 9); part_stat_unlock(); } @@ -1506,6 +1524,7 @@ unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors, update_io_ticks(part, now, false); part_stat_inc(part, ios[sgrp]); part_stat_add(part, sectors[sgrp], sectors); + blk_additional_sector(part, sgrp, sectors); part_stat_local_inc(part, in_flight[op_is_write(op)]); part_stat_unlock(); diff --git a/block/genhd.c b/block/genhd.c index a33937a74fb1..68e4735662f3 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1441,6 +1441,26 @@ static ssize_t io_latency_show(struct device *dev, struct device_attribute *attr static struct device_attribute dev_attr_io_latency = __ATTR(io_latency, 0444, io_latency_show, NULL); + +static ssize_t io_size_show(struct device *dev, struct device_attribute *attr, char *buf) +{ + struct hd_struct *p = dev_to_part(dev); + size_t count = 0; + int i, sgrp; + + for (i = 0; i < ADD_STAT_NUM; i++) { + count += scnprintf(buf + count, PAGE_SIZE - count, "%5d KB: ", 1 << i); + for (sgrp = 0; sgrp < NR_STAT_GROUPS; sgrp++) + count += scnprintf(buf + count, PAGE_SIZE - count, "%lu ", + part_stat_read(p, size_table[i][sgrp])); + count += scnprintf(buf + count, PAGE_SIZE - count, "\n"); + } + + return count; +} + +static struct device_attribute dev_attr_io_size = + __ATTR(io_size, 0444, io_size_show, NULL); #endif static struct attribute *disk_attrs[] = { @@ -1464,6 +1484,7 @@ static struct attribute *disk_attrs[] = { #endif #ifdef CONFIG_BLK_ADDITIONAL_DISKSTAT &dev_attr_io_latency.attr, + &dev_attr_io_size.attr, #endif NULL }; diff --git a/include/linux/part_stat.h b/include/linux/part_stat.h index fe3def8c69d7..2b056cd70d1f 100644 --- a/include/linux/part_stat.h +++ b/include/linux/part_stat.h @@ -11,10 +11,11 @@ struct disk_stats { unsigned long merges[NR_STAT_GROUPS]; #ifdef CONFIG_BLK_ADDITIONAL_DISKSTAT /* - * We measure latency (ms) for 1, 2, ..., 1024 and >=1024. + * We measure latency (ms) and size (sector) for 1, 2, ..., 1024 and >=1024. */ #define ADD_STAT_NUM 12 unsigned long latency_table[ADD_STAT_NUM][NR_STAT_GROUPS]; + unsigned long size_table[ADD_STAT_NUM][NR_STAT_GROUPS]; #endif unsigned long io_ticks; local_t in_flight[2];