From: <ning.bo9@zte.com.cn>
To: <stefanha@gmail.com>
Cc: mst@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re:[Qemu-devel] [PATCH v2] vhost-vsock: report QMP event whensetrunning
Date: Fri, 13 Dec 2019 15:11:54 +0800 (CST) [thread overview]
Message-ID: <201912131511549044400@zte.com.cn> (raw)
In-Reply-To: <20191212110525.GA1141992@stefanha-x1.localdomain>
[-- Attachment #1.1: Type: text/plain, Size: 1805 bytes --]
> This can be done efficiently as follows:
> 1. kata-runtime listens on a vsock port
> 2. kata-agent-port=PORT is added to the kernel command-line options
> 3. kata-agent parses the port number and connects to the host
>
> This eliminates the reconnection attempts.
There will be an additional problem if do this:
Who decides which port the `runtime` should listen?
Consider the worst case:
The ports selected by two `runtime` running in parallel always conflict,
and this case is unavoidable, even if we can reduce the possibility of conflicts through algorithms.
Because we don't have a daemon that can allocate unique port to `runtime`.
> Userspace APIs to avoid the 2 second wait already exist:
>
> 1. The SO_VM_SOCKETS_CONNECT_TIMEOUT socket option controls the connect
> timeout for this socket.
Yes, it has the same effect
> 2. Non-blocking connect allows the userspace process to do other things
> while a connection attempt is being made.
I don't think the `tunime` has anything to do except wait for the response from the `agent` at that moment
Now let me sort out the currently known methods:
1. `runtime` does not connect until it receives the qmp event reported by qemu when the `agent` opens the vsock device.
- The method looks inappropriate now.
2. adding a special case for vhost_vsock.ko.
- Also inappropriate.
3. connect to `runtime` from `agent`.
- `runtime` may not be able to choose the right port.
4. Use `SO_VM_SOCKETS_CONNECT_TIMEOUT` option.
- The effect is similar to method 2, no need to modify the kernel module code.
I have an additional question:
If useing method 4, when `runtime` calls connect use NONBLOCK option with very short timeout in an infinite loop, the kernel maybe frequently creates timers. Is there any other side effects?
[-- Attachment #2: signature.asc --]
[-- Type: application/octet-stream, Size: 500 bytes --]
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAl3yHvUACgkQnKSrs4Gr
c8jg5ggAqaIQAS2Z81lTIi4bs475raquTl3SUzc+6T8yciP/Xs1Sb7tVdHx3WwFq
v1eqefEKrNNpdjUncOKoHRa4uMQZJSlVaJCsEmHUKBGOQPi+hJ8X0Q57/w4hEYQ6
bXrVPlwFK1vBzPPTr1w4qKbKIJyqCYrjhxUxr2KeVr1q8jpvdxnXTILTLWU1JCNS
Fh1l69CTM0RjtRiW4mbskNspNCluS5sq3KG0PMCBW+VqPNP9rXL6C3qpIwM1RY9p
XTrUNSS4wqRNXl2Ug/Pt52Vwr4YAAezsyC+JOCUZbC3nvzR/C2L4i1p/HLVvOuDI
9nsEqtr1Cj7xBuCKq9KCTfS2jpCsTg==
=0QNN
-----END PGP SIGNATURE-----
\r
next prev parent reply other threads:[~2019-12-13 7:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 3:32 [Qemu-devel] [PATCH v2] vhost-vsock: report QMP event when set running Ning Bo
2019-08-09 13:41 ` Stefan Hajnoczi
2019-11-28 11:26 ` Re:[Qemu-devel] [PATCH v2] vhost-vsock: report QMP event when setrunning ning.bo9
2019-12-12 11:05 ` [Qemu-devel] " Stefan Hajnoczi
2019-12-12 11:24 ` Michael S. Tsirkin
2019-12-19 11:18 ` Stefan Hajnoczi
2019-12-13 7:11 ` ning.bo9 [this message]
2019-12-19 11:35 ` [Qemu-devel] [PATCH v2] vhost-vsock: report QMP event whensetrunning Stefan Hajnoczi
2019-12-20 2:38 ` Re:[Qemu-devel] [PATCH v2] vhost-vsock: report QMP eventwhensetrunning ning.bo9
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=201912131511549044400@zte.com.cn \
--to=ning.bo9@zte.com.cn \
--cc=armbru@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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 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).