qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Alberto Garcia <berto@igalia.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations
Date: Tue, 13 Oct 2015 16:42:33 +0100	[thread overview]
Message-ID: <20151013154233.GJ3057@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <84322c385b597a29ec217efd7fe99560a0bbc5d8.1443793122.git.berto@igalia.com>

On Fri, Oct 02, 2015 at 05:26:17PM +0300, Alberto Garcia wrote:
> +void block_acct_failed(BlockAcctStats *stats, BlockAcctCookie *cookie)
> +{
> +    int64_t time_ns = qemu_clock_get_ns(clock_type);
> +
> +    assert(cookie->type < BLOCK_MAX_IOTYPE);
> +
> +    stats->failed_ops[cookie->type]++;
> +    stats->total_time_ns[cookie->type] += time_ns - cookie->start_time_ns;
> +    stats->last_access_time_ns = time_ns;
> +}
> +
> +void block_acct_invalid(BlockAcctStats *stats, enum BlockAcctType type)
> +{
> +    assert(type < BLOCK_MAX_IOTYPE);
> +
> +    stats->invalid_ops[type]++;
> +    stats->last_access_time_ns = qemu_clock_get_ns(clock_type);
> +}

block_acct_failed() updates total_time_ns[] but block_acct_invalid()
does not.  I guess that's because block_acct_invalid() is expected to
happen during request submission and has effectively 0 duration?

This deserves a comment.

  reply	other threads:[~2015-10-13 15:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02 14:26 [Qemu-devel] [PATCH v2 00/22] Extended I/O accounting Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 01/22] xen_disk: Account for flush operations Alberto Garcia
2015-10-13 10:36   ` Stefan Hajnoczi
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 02/22] ide: Account for write operations correctly Alberto Garcia
2015-10-13 10:45   ` Stefan Hajnoczi
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 03/22] block: define 'clock_type' for the accounting code Alberto Garcia
2015-10-13 12:27   ` Stefan Hajnoczi
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 04/22] util: Infrastructure for computing recent averages Alberto Garcia
2015-10-13 15:32   ` Stefan Hajnoczi
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 05/22] block: Add idle_time_ns to BlockDeviceStats Alberto Garcia
2015-10-13 15:35   ` Stefan Hajnoczi
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats Alberto Garcia
2015-10-13 15:38   ` Stefan Hajnoczi
2015-10-15 13:06     ` Alberto Garcia
2015-10-15 14:58       ` Stefan Hajnoczi
2015-10-16  9:49         ` Alberto Garcia
2015-10-21 10:01           ` Stefan Hajnoczi
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations Alberto Garcia
2015-10-13 15:42   ` Stefan Hajnoczi [this message]
2015-10-13 15:51     ` Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 08/22] block: Allow configuring whether to account failed and invalid ops Alberto Garcia
2015-10-13 15:43   ` Stefan Hajnoczi
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 09/22] block: Compute minimum, maximum and average I/O latencies Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 10/22] block: Add average I/O queue depth to BlockDeviceTimedStats Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 11/22] block: New option to define the intervals for collecting I/O statistics Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 12/22] qemu-io: Account for failed, invalid and flush operations Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 13/22] block: Use QEMU_CLOCK_VIRTUAL for the accounting code in qtest mode Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 14/22] iotests: Add test for the block device statistics Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 15/22] nvme: Account for failed and invalid operations Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 16/22] virtio-blk: " Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 17/22] xen_disk: " Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 18/22] atapi: " Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 19/22] ide: " Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 20/22] macio: Account for failed operations Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 21/22] scsi-disk: " Alberto Garcia
2015-10-02 14:26 ` [Qemu-devel] [PATCH v2 22/22] block: Update copyright of the accounting code Alberto Garcia

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=20151013154233.GJ3057@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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).