[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 07/22] block: Add statistics for failed and i
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations |
Date: |
Tue, 13 Oct 2015 17:51:48 +0200 |
User-agent: |
Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) |
On Tue 13 Oct 2015 05:42:33 PM CEST, Stefan Hajnoczi <address@hidden> wrote:
> 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?
That's right, I put it in the commit message but I guess it's a good
idea to mention it here as well.
I was actually updating total_time_ns[] in block_acct_invalid() as well,
but then when I was adding the block_acct_invalid() calls to the device
models I realized that most/all of them happen before we even call
block_acct_start(). So I decided to leave it like it is now, first
because it makes the code simpler and second because as you say there
would be no I/O to measure.
Berto
- Re: [Qemu-devel] [PATCH v2 04/22] util: Infrastructure for computing recent averages, (continued)
- [Qemu-devel] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations, Alberto Garcia, 2015/10/08
- [Qemu-devel] [PATCH v2 03/22] block: define 'clock_type' for the accounting code, Alberto Garcia, 2015/10/08
- [Qemu-devel] [PATCH v2 09/22] block: Compute minimum, maximum and average I/O latencies, Alberto Garcia, 2015/10/08
- [Qemu-devel] [PATCH v2 11/22] block: New option to define the intervals for collecting I/O statistics, Alberto Garcia, 2015/10/08
- [Qemu-devel] [PATCH v2 02/22] ide: Account for write operations correctly, Alberto Garcia, 2015/10/08
- [Qemu-devel] [PATCH v2 21/22] scsi-disk: Account for failed operations, Alberto Garcia, 2015/10/08
- [Qemu-devel] [PATCH v2 13/22] block: Use QEMU_CLOCK_VIRTUAL for the accounting code in qtest mode, Alberto Garcia, 2015/10/08
- [Qemu-devel] [PATCH v2 20/22] macio: Account for failed operations, Alberto Garcia, 2015/10/08
- [Qemu-devel] [PATCH v2 14/22] iotests: Add test for the block device statistics, Alberto Garcia, 2015/10/08