All of lore.kernel.org
 help / color / mirror / Atom feed
From: xiezhide <xiezhide@huawei.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"berto@igalia.com" <berto@igalia.com>,
	zengcanfu 00215970 <zengcanfu@huawei.com>,
	"groug@kaod.org" <groug@kaod.org>,
	"aneesh.kumar@linux.vnet.ibm.com"
	<aneesh.kumar@linux.vnet.ibm.com>,
	Jinxuefeng <jinxuefeng@huawei.com>,
	"Chenhui (Felix, Euler)" <chenhui.rtos@huawei.com>
Subject: Re: [Qemu-devel] [PATCH v5 2/6] fsdev-throttle-qmp: Rename the ThrottleLimits member names
Date: Thu, 29 Nov 2018 07:10:07 +0000	[thread overview]
Message-ID: <A02D6AA901860840B46E751C5E9E38B43CC9CD0F@dggeml512-mbs.china.huawei.com> (raw)
In-Reply-To: <87ftvlh7us.fsf@dusky.pond.sub.org>


> Subject: Re: [Qemu-devel] [PATCH v5 2/6] fsdev-throttle-qmp: Rename the
> ThrottleLimits member names
> 
> xiezhide <xiezhide@huawei.com> writes:
> 
> > Rename the ThrottleLimits member names and modify related code
> >
> > Signed-off-by: xiezhide <xiezhide@huawei.com>
> > ---
> >  qapi/block-core.json |  70 +++++++++++-----------
> >  util/throttle.c      | 163
> +++++++++++++++++++++++++--------------------------
> >  2 files changed, 116 insertions(+), 117 deletions(-)
> >
> > diff --git a/qapi/block-core.json b/qapi/block-core.json index
> > d4fe710..4ffaaea 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -2240,45 +2240,45 @@
> >  # transaction. All fields are optional. When setting limits, if a
> > field is  # missing the current value is not changed.
> >  #
> > -# @iops-total:             limit total I/O operations per second
> > -# @iops-total-max:         I/O operations burst
> > -# @iops-total-max-length:  length of the iops-total-max burst period, in
> seconds
> > -#                          It must only be set if @iops-total-max is set
> as well.
> > -# @iops-read:              limit read operations per second
> > -# @iops-read-max:          I/O operations read burst
> > -# @iops-read-max-length:   length of the iops-read-max burst period, in
> seconds
> > -#                          It must only be set if @iops-read-max is set
> as well.
> > -# @iops-write:             limit write operations per second
> > -# @iops-write-max:         I/O operations write burst
> > -# @iops-write-max-length:  length of the iops-write-max burst period, in
> seconds
> > -#                          It must only be set if @iops-write-max is
> set as well.
> > -# @bps-total:              limit total bytes per second
> > -# @bps-total-max:          total bytes burst
> > -# @bps-total-max-length:   length of the bps-total-max burst period, in
> seconds.
> > -#                          It must only be set if @bps-total-max is set
> as well.
> > -# @bps-read:               limit read bytes per second
> > -# @bps-read-max:           total bytes read burst
> > -# @bps-read-max-length:    length of the bps-read-max burst period, in
> seconds
> > -#                          It must only be set if @bps-read-max is set
> as well.
> > -# @bps-write:              limit write bytes per second
> > -# @bps-write-max:          total bytes write burst
> > -# @bps-write-max-length:   length of the bps-write-max burst period, in
> seconds
> > -#                          It must only be set if @bps-write-max is set
> as well.
> > -# @iops-size:              when limiting by iops max size of an I/O in
> bytes
> > +# @iops:             limit total I/O operations per second
> > +# @iops_max:         I/O operations burst
> > +# @iops_max_length:  length of the iops_total_max burst period, in
> seconds
> > +#                          It must only be set if @iops_total_max is
> set as well.
> > +# @iops_rd:              limit read operations per second
> > +# @iops_rd_max:          I/O operations read burst
> > +# @iops_rd_max_length:   length of the iops_read_max burst period, in
> seconds
> > +#                          It must only be set if @iops_read_max is
> set as well.
> > +# @iops_wr:             limit write operations per second
> > +# @iops_wr_max:         I/O operations write burst
> > +# @iops_wr_max_length:  length of the iops_write_max burst period, in
> seconds
> > +#                          It must only be set if @iops_write_max is
> set as well.
> > +# @bps:              limit total bytes per second
> > +# @bps_max:          total bytes burst
> > +# @bps_max_length:   length of the bps_total_max burst period, in
> seconds.
> > +#                          It must only be set if @bps_total_max is
> set as well.
> > +# @bps_rd:               limit read bytes per second
> > +# @bps_rd_max:           total bytes read burst
> > +# @bps_rd_max_length:    length of the bps_read_max burst period, in
> seconds
> > +#                          It must only be set if @bps_read_max is
> set as well.
> > +# @bps_wr:              limit write bytes per second
> > +# @bps_wr_max:          total bytes write burst
> > +# @bps_wr_max_length:   length of the bps_write_max burst period, in
> seconds
> > +#                          It must only be set if @bps_write_max is
> set as well.
> > +# @iops_size:              when limiting by iops max size of an I/O in
> bytes
> >  #
> >  # Since: 2.11
> >  ##
> >  { 'struct': 'ThrottleLimits',
> > -  'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
> > -            '*iops-total-max-length' : 'int', '*iops-read' : 'int',
> > -            '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
> > -            '*iops-write' : 'int', '*iops-write-max' : 'int',
> > -            '*iops-write-max-length' : 'int', '*bps-total' : 'int',
> > -            '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
> > -            '*bps-read' : 'int', '*bps-read-max' : 'int',
> > -            '*bps-read-max-length' : 'int', '*bps-write' : 'int',
> > -            '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
> > -            '*iops-size' : 'int' } }
> > +  'data': { '*iops' : 'int', '*iops_max' : 'int',
> > +            '*iops_max_length' : 'int', '*iops_rd' : 'int',
> > +            '*iops_rd_max' : 'int', '*iops_rd_max_length' : 'int',
> > +            '*iops_wr' : 'int', '*iops_wr_max' : 'int',
> > +            '*iops_wr_max_length' : 'int', '*bps' : 'int',
> > +            '*bps_max' : 'int', '*bps_max_length' : 'int',
> > +            '*bps_rd' : 'int', '*bps_rd_max' : 'int',
> > +            '*bps_rd_max_length' : 'int', '*bps_wr' : 'int',
> > +            '*bps_wr_max' : 'int', '*bps_wr_max_length' : 'int',
> > +            '*iops_size' : 'int' } }
> 
> Compatibility break.  Why is that okay?
> 
> Even if it is, you still run afoul of docs/devel/qapi-code-gen.txt:
> 
>     Command names, and member names within a type, should be all lower
>     case with words separated by a hyphen.  However, some existing older
>     commands and complex types use underscore; when extending such
>     expressions, consistency is preferred over blindly avoiding
>     underscore.
> 
> The exception doesn't apply here.

Why did this changing:
1. ThrottleLimits is just use for block device, this change not break compatibility
2. can share same base struct in json file
3. can reuse same code between block and fsdev device for io throttling
4. can keep the same qmp command style for block and fsdev with less codes

Block:
{ "execute": "block_set_io_throttle",
     "arguments": {
        "device": "virtio0",
        "iops": 100,
        "iops_rd": 0,
        "iops_wr": 0,
        "bps": 0,
        "bps_rd": 0,
        "bps_wr": 0
     }
   }

Fsdev:
{ "execute": "fsdev-set-io-throttle",
    "arguments": {
        "id": "extra-9p-kataTest"
        "iops": 100,
        "iops_rd": 0,
        "iops_wr": 0,
        "bps": 0,
        "bps_rd": 0,
        "bps_wr": 0
     }
   }

Thanks
xiezhide

> 
> >
> >  ##
> >  # @block-stream:
> [...]

  parent reply	other threads:[~2018-11-29  7:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16  7:58 [Qemu-devel] [PATCH v5 0/6] fsdev-throttle-qmp: qmp interface for fsdev io throttling xiezhide
2018-11-16  7:59 ` [Qemu-devel] [PATCH v5 1/6] fsdev-throttle-qmp: factor out throttle code to reuse code xiezhide
2018-11-22 14:46   ` Greg Kurz
2018-11-23  6:42     ` xiezhide
2018-11-16  7:59 ` [Qemu-devel] [PATCH v5 2/6] fsdev-throttle-qmp: Rename the ThrottleLimits member names xiezhide
2018-11-28  9:25   ` Markus Armbruster
2018-11-28 13:09     ` Eric Blake
2018-11-29  7:23       ` xiezhide
2018-11-29  8:59       ` Markus Armbruster
2018-11-30  1:39         ` xiezhide
2018-11-29  7:10     ` xiezhide [this message]
2018-11-16  7:59 ` [Qemu-devel] [PATCH v5 3/6] fsdev-throttle-qmp: Rewrite BlockIOThrottle with ThrottleLimits as its base class xiezhide
2018-11-16  8:00 ` [Qemu-devel] [PATCH v5 4/6] fsdev-throttle-qmp: Move ThrottleLimits into a new file for future reuse xiezhide
2018-11-16  8:00 ` [Qemu-devel] [PATCH v5 5/6] fsdev-throttle-qmp: qmp interface for fsdev io throttling xiezhide
2018-11-16  8:00 ` [Qemu-devel] [PATCH v5 6/6] fsdev-throttle-qmp: hmp " xiezhide

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=A02D6AA901860840B46E751C5E9E38B43CC9CD0F@dggeml512-mbs.china.huawei.com \
    --to=xiezhide@huawei.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=chenhui.rtos@huawei.com \
    --cc=groug@kaod.org \
    --cc=jinxuefeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zengcanfu@huawei.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.