From: Markus Armbruster <armbru@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 00/25] qmp: add async command type
Date: Fri, 05 May 2017 14:35:25 +0200 [thread overview]
Message-ID: <877f1viir6.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <CAJ+F1C+MvHoMtaUUWDDmoFJWEXiaK1FxeZ8csqTOEB76WSPDRA@mail.gmail.com> ("Marc-André Lureau"'s message of "Fri, 05 May 2017 09:00:17 +0000")
Marc-André Lureau <marcandre.lureau@gmail.com> writes:
> Hi
>
> On Thu, May 4, 2017 at 11:02 PM Markus Armbruster <armbru@redhat.com> wrote:
>
>> I figure everyone interested has had his say. Let me try to summarize
>> and draw my conclusions.
>>
>> Commands + events can replace asynchronous commands (they did).
>>
>> Asynchronous commands cannot replace events, because "interesting" side
>> effects of commands need to be broadcast. Doesn't mean asynchronous
>> commands can't make sense for us. Does mean that we need to address any
>> serious flaws in the existing commands + event mechanism even if we
>> adopt asynchronous commands. The cover letter lists multiple flaws,
>> which I'll discuss inline.
>>
>> If an operation satisfies certain conditions, then implementing it as
>> asynchronous command provides certain benefits. If the operation
>>
>> (C1) does not need to broadcast state changes, including start and end
>> of operation, and
>>
>> (C2) even the initiating client needs no state change notifications
>> except for end of operation, and
>>
>> (C3) even that isn't needed when the client loses the connection and
>> reconnects, and
>>
>> (C4) the operation doesn't have to be examined or controlled while it
>> runs,
>>
>> then making it an asynchronous command
>>
>> (B1) saves you the trouble of defining an event together with its link
>> to the command, and
>>
>> (B2) saves you the trouble of sending the event, and
>>
>> (B3) saves a bit of QMP traffic, namely the event broadcast.
>>
>> Letting clients opt into the asynchronousness as this series does
>> provides an additional benefit:
>>
>> (B4) when you find one of your synchronous commands is at times taking
>> too long, you can compatibly evolve it.
>>
>> We can remove (C3) and (C4) by providing suitable ways to examine and
>> control asynchronous commands while they run.
>>
>> We could remove (C1) and (C2) by sending events, but that would also
>> lose pretty much all benefits.
>>
>> The operation chosen to showcase asynchronous commands is taking
>> screenshots. It obviously satisfies (C1). I guess for (C2) and (C4) we
>> have to assume that it completes "quickly". I'm willing to buy that.
>> (C3) seems pretty dubious to me, however.
>>
>> The tradeoff to judge is desirability of the benefits vs. cost to get
>> them.
>>
>> Desirability depends on how many commands satisfy these conditions, and
>> how much trouble exactly is saved.
>>
>> A list of commands that is more complete than just "screendump" would
>> help with the former. query- commands that need to gather information
>> in ways that could block are among the candidates.
>>
>> On the latter, I figure (B1) dwarves (B2), (B3) is a relatively minor
>> optimization unless proven otherwise, and (B4) is real, but asynchronous
>> commands are not the only way to get it; we can equally well evolve
>> synchronous commands compatibly into synchronous + event.
>>
>> The cost is interface and implementation complexity.
>>
>> Interface complexity increases because we add the concept "asynchronous
>> command" and the concept "synchronous or asynchronous command, client's
>> choice". This is my main concern.
>>
>
> Since we already have client dispatch of unrelated reply and hidden-async
> pattern, this is less of a concern in practice, most of the complexity has
> to be already handled.
Yes, we already handle the abstract concept of kicking off operations
and getting notified when they change state. But we handle it in *one*
abstract way: command + event(s). Adding a second way (asynchronous
commands) can only increase complexity.
> Note it is a bit simpler for a client to handle a generic async return
> rather than various events.
I posit that the complexitity difference between zero and one instances
of command + event far exceeds the one between one and multiple.
Same for asynchronous commands.
The increase in conceptual complexity might be offset by a decrease in
individual operations' complexity. That's (B1).
Your best estimate of the overall complexity change is more favourable
than mine. That's okay, you're as entitled to your opinion as I am.
But my duty is to come up with my own best estimate, and act on it.
>> Implementation complexity isn't prohibitive according to diffstat, but
>> it's not neglible, either: with the last six patches peeled off, we get
>> some 500 additional lines plus some 300 in tests/. The last six patches
>> put the new infrastructure to work, which takes another 200. Ways to
>> examine and control asynchronous commands while they run would add some
>> more, but we don't know how much exactly.
>>
>> Now let me take a step back: we need to crack the "jobs" problem anyway.
>> Merging this series now would in a way add another special case of the
>> general case "jobs" before adding the general case. In other words,
>> create more stuff to unify. I'm afraid that's a bad idea, not least
>> since it's an external interface. I think we should do "jobs" first.
>> Once we got at least a prototype, we can
>>
>> * judge how onerous defining and implementing jobs really is, i.e. have
>> a clearer idea of the potential benefits of asynchronous commands, and
>>
>> * explore asynchronous commands as a special case of "jobs" optimized
>> for operations that satisfy the conditions above, i.e. get a clearer
>> idea of the *actual* additional implementation complexity.
>>
>
> That's what I have been told for over 1.5y :) I would like to know the list
> of requirements / features "jobs" would have. I am willing to help
> implementing it.
We have multiple use cases for generic jobs infrastructure in various
subsystems, but the ones driving the work are the block subsystem's,
simply because the existing block jobs need a major revamp anyway. The
people most familiar with the requirements are John Snow, Kevin Wolf,
Stefan Hajnoczi, and to a lesser degree myself. Recommend to meet John
in front of a big whiteboard, or else the next best way to talk things
over you two can find.
>> Bottom line:
>>
>> 1. I still don't want to merge this.
>>
>> 2. I want us to tackle jobs sooner rather than later.
>>
>> 3. Once we got at least a jobs prototype, I'm willing to reconsider
>> asynchronous commands implemented as special case of jobs.
>>
>>
> Who is going to work on it?
I hope John can work on jobs.
>> One of the most important maintainer duties is saying "no". It's also
>> one of the least fun duties.
>>
>>
> It doesn't sound like a "no" :)
Well, it's as close to "no" as you can get in a situation that's going
to change! It's a straight "no" for the current situation, and a
"maybe" for a future situation that will be different in ways we don't
yet understand.
I'm *not* encouraging you to pursue asynchronous QMP commands. In fact,
I never did, at least not knowingly. It's your decision. All I offer
is what I offer to all patch submitters: my best effort at a fair
hearing.
next prev parent reply other threads:[~2017-05-05 12:35 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 16:03 [Qemu-devel] [PATCH v2 00/25] qmp: add async command type Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 01/25] tests: start generic qemu-qmp tests Marc-André Lureau
2017-01-18 16:14 ` Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 02/25] tests: change /0.15/* tests to /qmp/* Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 03/25] qmp: teach qmp_dispatch() to take a pre-filled QDict Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 04/25] qmp: use a return callback for the command reply Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 05/25] qmp: add QmpClient Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 06/25] qmp: add qmp_return_is_cancelled() Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 07/25] qmp: introduce async command type Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 08/25] qapi: ignore top-level 'id' field Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 09/25] qmp: take 'id' from request Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 10/25] qmp: check that async command have an 'id' Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 11/25] scripts: learn 'async' qapi commands Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 12/25] tests: add dispatch async tests Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 13/25] monitor: add 'async' capability Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 14/25] monitor: add !qmp pre-conditions Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 15/25] monitor: suspend when running async and client has no async Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 16/25] qmp: update qmp-spec about async capability Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 17/25] qtest: add qtest-timeout Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 18/25] qtest: add qtest_init_qmp_caps() Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 19/25] tests: add tests for async and non-async clients Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 20/25] qapi: improve 'screendump' documentation Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 21/25] console: graphic_hw_update return true if async Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 22/25] console: add graphic_hw_update_done() Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 23/25] console: make screendump async Marc-André Lureau
2017-01-19 8:20 ` Gerd Hoffmann
2017-01-20 13:07 ` Marc-André Lureau
2017-01-23 12:04 ` Gerd Hoffmann
2017-01-23 12:35 ` Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 24/25] qtest: add /qemu-qmp/screendump test Marc-André Lureau
2017-01-18 16:03 ` [Qemu-devel] [PATCH v2 25/25] qmp: move json-message-parser and check to QmpClient Marc-André Lureau
2017-01-18 17:35 ` [Qemu-devel] [PATCH v2 00/25] qmp: add async command type no-reply
2017-01-23 10:55 ` Stefan Hajnoczi
2017-01-23 11:27 ` Marc-André Lureau
2017-01-24 11:43 ` Stefan Hajnoczi
2017-01-24 18:43 ` Marc-André Lureau
2017-01-30 13:43 ` Stefan Hajnoczi
2017-01-30 18:18 ` Marc-André Lureau
2017-01-31 7:43 ` Gerd Hoffmann
2017-01-31 8:18 ` Markus Armbruster
2017-02-01 16:25 ` Stefan Hajnoczi
2017-02-01 20:25 ` Marc-André Lureau
2017-02-02 10:13 ` Stefan Hajnoczi
2017-01-25 15:16 ` Markus Armbruster
2017-04-24 19:10 ` Markus Armbruster
2017-04-25 0:06 ` John Snow
2017-04-25 6:55 ` Markus Armbruster
2017-04-25 9:13 ` Daniel P. Berrange
2017-04-25 10:22 ` Kevin Wolf
2017-04-28 15:55 ` Marc-André Lureau
2017-04-28 19:13 ` Kevin Wolf
2017-05-02 8:30 ` Gerd Hoffmann
2017-05-02 9:05 ` Marc-André Lureau
2017-05-02 10:42 ` Kevin Wolf
2017-05-04 19:01 ` Markus Armbruster
2017-05-05 9:00 ` Marc-André Lureau
2017-05-05 12:35 ` Markus Armbruster [this message]
2017-05-05 12:54 ` Marc-André Lureau
2017-05-05 13:50 ` Markus Armbruster
2017-05-05 12:27 ` Kevin Wolf
2017-05-05 12:51 ` Markus Armbruster
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=877f1viir6.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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.