qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/3] block: latency accounting
Date: Fri, 26 Aug 2011 15:05:06 +0200	[thread overview]
Message-ID: <4E579A02.7090304@redhat.com> (raw)
In-Reply-To: <20110825062610.GC30639@lst.de>

Am 25.08.2011 08:26, schrieb Christoph Hellwig:
> Account the total latency for read/write/flush requests.  This allows
> management tools to average it based on a snapshot of the nr ops
> counters and allow checking for SLAs or provide statistics.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: qemu/block.c
> ===================================================================
> --- qemu.orig/block.c	2011-08-25 08:01:12.000000000 +0200
> +++ qemu/block.c	2011-08-25 08:03:02.908005646 +0200
> @@ -1889,12 +1889,18 @@ static void bdrv_stats_iter(QObject *dat
>                          " rd_operations=%" PRId64
>                          " wr_operations=%" PRId64
>                          " flush_operations=%" PRId64
> +                        " wr_total_time_ns=%" PRId64
> +                        " rd_total_time_ns=%" PRId64
> +                        " flush_total_time_ns=%" PRId64
>                          "\n",
>                          qdict_get_int(qdict, "rd_bytes"),
>                          qdict_get_int(qdict, "wr_bytes"),
>                          qdict_get_int(qdict, "rd_operations"),
>                          qdict_get_int(qdict, "wr_operations"),
> -                        qdict_get_int(qdict, "flush_operations"));
> +                        qdict_get_int(qdict, "flush_operations"),
> +                        qdict_get_int(qdict, "wr_total_time_ns"),
> +                        qdict_get_int(qdict, "rd_total_time_ns"),
> +                        qdict_get_int(qdict, "flush_total_time_ns"));
>  }
>  
>  void bdrv_stats_print(Monitor *mon, const QObject *data)
> @@ -1913,7 +1919,10 @@ static QObject* bdrv_info_stats_bs(Block
>                               "'rd_operations': %" PRId64 ","
>                               "'wr_operations': %" PRId64 ","
>                               "'wr_highest_offset': %" PRId64 ","
> -                             "'flush_operations': %" PRId64
> +                             "'flush_operations': %" PRId64 ","
> +                             "'wr_total_time_ns': %" PRId64 ","
> +                             "'rd_total_time_ns': %" PRId64 ","
> +                             "'flush_total_time_ns': %" PRId64
>                               "} }",
>                               bs->nr_bytes[BDRV_ACCT_READ],
>                               bs->nr_bytes[BDRV_ACCT_WRITE],
> @@ -1921,7 +1930,10 @@ static QObject* bdrv_info_stats_bs(Block
>                               bs->nr_ops[BDRV_ACCT_WRITE],
>                               bs->wr_highest_sector *
>                               (uint64_t)BDRV_SECTOR_SIZE,
> -                             bs->nr_ops[BDRV_ACCT_FLUSH]);
> +                             bs->nr_ops[BDRV_ACCT_FLUSH],
> +                             bs->total_time_ns[BDRV_ACCT_READ],
> +                             bs->total_time_ns[BDRV_ACCT_WRITE],
> +                             bs->total_time_ns[BDRV_ACCT_FLUSH]);

The order of READ vs. WRITE is wrong here, so read latencies show up as
wr_total_time. I can fix it locally if you agree that swapping the two
lines is the right fix.

Kevin

  reply	other threads:[~2011-08-26 13:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-21 22:25 [Qemu-devel] [PATCH 0/3] better I/O accounting V2 Christoph Hellwig
2011-08-21 22:25 ` [Qemu-devel] [PATCH 1/3] block: include flush requests in info blockstats Christoph Hellwig
2011-08-21 22:26 ` [Qemu-devel] [PATCH 2/3] block: explicit I/O accounting Christoph Hellwig
2011-08-22 15:48   ` Kevin Wolf
2011-08-24 18:22     ` Christoph Hellwig
2011-08-21 22:26 ` [Qemu-devel] [PATCH 3/3] block: latency accounting Christoph Hellwig
2011-08-22  8:45 ` [Qemu-devel] [PATCH 0/3] better I/O accounting V2 Stefan Hajnoczi
2011-08-22 14:59 ` Ryan Harper
2011-08-22 15:12   ` Christoph Hellwig
2011-08-22 15:29     ` Ryan Harper
2011-08-22 15:35       ` Christoph Hellwig
2011-08-22 16:46         ` Ryan Harper
2011-08-24 18:45           ` Christoph Hellwig
2011-08-25 16:41             ` Ryan Harper
2011-08-22 15:55 ` Kevin Wolf
2011-08-25  6:25 ` [Qemu-devel] [PATCH 0/3] better I/O accounting V3 Christoph Hellwig
2011-08-25  6:25   ` [Qemu-devel] [PATCH 1/3] block: include flush requests in info blockstats Christoph Hellwig
2011-08-25  6:26   ` [Qemu-devel] [PATCH 2/3] block: explicit I/O accounting Christoph Hellwig
2011-08-25  6:26   ` [Qemu-devel] [PATCH 3/3] block: latency accounting Christoph Hellwig
2011-08-26 13:05     ` Kevin Wolf [this message]
2011-08-26 16:06       ` Christoph Hellwig
2011-08-25 16:10   ` [Qemu-devel] [PATCH 0/3] better I/O accounting V3 Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2011-08-11 23:44 [Qemu-devel] [PATCH 0/3] better I/O accounting Christoph Hellwig
2011-08-11 23:44 ` [Qemu-devel] [PATCH 3/3] block: latency accounting Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E579A02.7090304@redhat.com \
    --to=kwolf@redhat.com \
    --cc=hch@lst.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).