All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Nefedov <anton.nefedov@virtuozzo.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"kwolf@redhat.com" <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	"famz@redhat.com" <famz@redhat.com>,
	Denis Lunev <den@virtuozzo.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	"mreitz@redhat.com" <mreitz@redhat.com>,
	"berto@igalia.com" <berto@igalia.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"jsnow@redhat.com" <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 9/9] qapi: query-blockstat: add driver specific file-posix stats
Date: Thu, 13 Dec 2018 15:20:51 +0000	[thread overview]
Message-ID: <9567be7b-f372-ef64-72f4-4ba2a361b9b9@virtuozzo.com> (raw)
In-Reply-To: <8736r1bou7.fsf@dusky.pond.sub.org>

On 13/12/2018 3:20 PM, Markus Armbruster wrote:
> I'm reviewing just the QAPI schema today.
> 
> Anton Nefedov <anton.nefedov@virtuozzo.com> writes:
> 
>> A block driver can provide a callback to report driver-specific
>> statistics.
>>
>> file-posix driver now reports discard statistics
>>
>> Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
>> ---
>>   qapi/block-core.json      | 38 ++++++++++++++++++++++++++++++++++++++
>>   include/block/block.h     |  1 +
>>   include/block/block_int.h |  1 +
>>   block.c                   |  9 +++++++++
>>   block/file-posix.c        | 32 ++++++++++++++++++++++++++++++++
>>   block/qapi.c              |  5 +++++
>>   6 files changed, 86 insertions(+)
>>
>> diff --git a/qapi/block-core.json b/qapi/block-core.json
>> index 959358ccc4..b100e852c7 100644
>> --- a/qapi/block-core.json
>> +++ b/qapi/block-core.json
>> @@ -877,6 +877,41 @@
>>              '*x_wr_latency_histogram': 'BlockLatencyHistogramInfo',
>>              '*x_flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
>>   
>> +##
>> +# @BlockStatsSpecificFile:
>> +#
>> +# File driver statistics
>> +#
>> +# @discard-nb-ok: The number of succeeded discard operations performed by
> 
> successful discard operations
> 

Fixed.

>> +#                 the driver.
>> +#
>> +# @discard-nb-failed: The number of failed discard operations performed by
>> +#                     the driver.
>> +#
>> +# @discard-bytes-ok: The number of bytes discarded by the driver.
>> +#
>> +# Since: 4.0
>> +##
>> +{ 'struct': 'BlockStatsSpecificFile',
>> +  'data': {
>> +      'discard-nb-ok': 'int',
>> +      'discard-nb-failed': 'int',
>> +      'discard-bytes-ok': 'int' } }
> 
> Should these be unsigned?
> 
> For what it's worth, similar counters nearby are also 'int'.
> 

And I just added these symmetrically.
Probably shouldn't have - let these be uint64.

>> +
>> +##
>> +# @BlockStatsSpecific:
>> +#
>> +# Block driver specific statistics
>> +#
>> +# Since: 4.0
>> +##
>> +{ 'union': 'BlockStatsSpecific',
>> +  'base': { 'driver': 'BlockdevDriver' },
>> +  'discriminator': 'driver',
>> +  'data': {
>> +      'file': 'BlockStatsSpecificFile',
>> +      'host_device': 'BlockStatsSpecificFile' } }
>> +
>>   ##
>>   # @BlockStats:
>>   #
>> @@ -892,6 +927,8 @@
>>   #
>>   # @stats:  A @BlockDeviceStats for the device.
>>   #
>> +# @driver-specific: Optional driver-specific stats. (Since 4.0)
>> +#
>>   # @parent: This describes the file block device if it has one.
>>   #          Contains recursively the statistics of the underlying
>>   #          protocol (e.g. the host file for a qcow2 image). If there is
>> @@ -905,6 +942,7 @@
>>   { 'struct': 'BlockStats',
>>     'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
>>              'stats': 'BlockDeviceStats',
>> +           '*driver-specific': 'BlockStatsSpecific',
>>              '*parent': 'BlockStats',
>>              '*backing': 'BlockStats'} }
>>   
> 
> Feels awkward.
> 
> When is @driver-specific present?  Exactly when the driver is 'file' or
> 'host_device'?  If that's correct, then turning BlockStats into a union
> would be clearer and reduce parenthesises on the wire:
> 
> { 'union': 'BlockStats',
>    'base': {
>        'driver': 'BlockdevDriver',
>        ... all the other existing members of BlockStats ... }
>    'discriminator': 'driver',
>    'data': {
>        'file': 'BlockStatsSpecificFile',
>        'host_device': 'BlockStatsSpecificFile' } }
> 
> [...]
> 

this series drags for quite a while - we already discussed this :)
In short: Blockdev does not always have driver, so it's either this
or adding weird BlockdevDriver values like "none".

http://lists.nongnu.org/archive/html/qemu-devel/2018-06/msg01845.html

  reply	other threads:[~2018-12-13 15:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 14:47 [Qemu-devel] [PATCH v6 0/9] discard blockstats Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 1/9] qapi: group BlockDeviceStats fields Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 2/9] qapi: add unmap to BlockDeviceStats Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 3/9] block: add empty account cookie type Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 4/9] ide: account UNMAP (TRIM) operations Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 5/9] scsi: store unmap offset and nb_sectors in request struct Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 6/9] scsi: move unmap error checking to the complete callback Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 7/9] scsi: account unmap operations Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 8/9] file-posix: account discard operations Anton Nefedov
2018-11-30 14:47 ` [Qemu-devel] [PATCH v6 9/9] qapi: query-blockstat: add driver specific file-posix stats Anton Nefedov
2018-12-03 14:24   ` Vladimir Sementsov-Ogievskiy
2018-12-13 12:20   ` Markus Armbruster
2018-12-13 15:20     ` Anton Nefedov [this message]
2018-12-13 16:05       ` Markus Armbruster
2019-02-21 12:36       ` Markus Armbruster
2019-01-14 13:16 ` [Qemu-devel] [PATCH v6 0/9] discard blockstats Anton Nefedov
2019-02-21  8:02   ` Anton Nefedov

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=9567be7b-f372-ef64-72f4-4ba2a361b9b9@virtuozzo.com \
    --to=anton.nefedov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=den@virtuozzo.com \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.