From: Jiahuan Zhang <jiahuanzhang90@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Hight Processor time of Socket communciation
Date: Wed, 19 Apr 2017 10:56:45 +0200 [thread overview]
Message-ID: <CAJy91Ca2FTvBzd2OqQZyEJBtCAxxosdcAFP1RMgGCQe2PJXEJA@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA-V3BNcrhhnap+Hn8spfZPd0=Dv2v0P5myGwqU2e5t0Eg@mail.gmail.com>
On 18 April 2017 at 18:26, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 18 April 2017 at 17:19, Jiahuan Zhang <jiahuanzhang90@gmail.com> wrote:
> > Dear QEMU developers,
> > I am measuring the processor time for guest-host communication via
> socket.
> > The guest app is to write a 5M image to a serial device.
> > The serial deivce is redirected to the socket in the command line.
> > The host app is to receive the data via socket until the peer closes the
> > connection.
> > Please find in the attachment the Processor time graph generated by
> Windows
> > Performance Monitor.
> >
> > The graph shows the processor time is almost 100% while communicating.
> > Surprising me! My expectation is 1%.
> >
> > I wonder if this is the right performance for QEMU socket communciation?
> Or
> > this high processor time is caused by the serial device? If so, any
> > optimization I can do?
>
> The serial device on the vexpress-a9 model is a PL011, which
> is a fairly simple UART which all data must be written to
> byte-at-a-time. This is never going to be fast, because we
> have to execute a lot of guest code to send the data through
> this byte-at-a-time bottleneck, and since you're running
> a purely emulated QEMU, executing guest code means doing
> a lot of CPU operations.
>
Hi Peter,
Do you mean that it is reasonable for QEMU emulation consumes high CPU time
when doing host-guest interaction, since the interaction calls many QEMU
codes in the background?
The situation i met is that,
1. after socket connection is done and i enter the guest kernel console,
QEMU's processor time is very low although some some callback functiona are
polling.
2. when i start the guest app to send data to the serial device, which is
redirected to the socket,
the processor time becomes very high.
3. when the data transfer is done, the processor time recovers to be low
again.
Since my guest app is rather simple and no while() is included, according
to your words,
can I conclude that the high processor time is cause by the callbacks for
guest to host data transfer?
> You will likely get better throughput if you use the 'virt' board
> where you can use the virtio-serial device which can send
> data more efficiently.
>
Here, can I understand your statement in this way,
a transmit buffer in the serial device for guest to host data transfer
may reduce the processor time, and in turn, increase the throughput?
Because the transmit buffer can enable multi-byte data to be transfered.
Then, taking the char-socket as an example, less tcp_char_write will be
called
when the "len" varible is larger than 1.
Please rectify me if my logic is wrong. Thanks.
Regards,
huan
> thanks
> -- PMM
>
next prev parent reply other threads:[~2017-04-19 8:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 16:19 [Qemu-devel] Hight Processor time of Socket communciation Jiahuan Zhang
2017-04-18 16:26 ` Peter Maydell
2017-04-19 8:56 ` Jiahuan Zhang [this message]
2017-04-19 9:15 ` Peter Maydell
2017-04-19 9:25 ` Jiahuan Zhang
2017-04-19 9:55 ` Peter Maydell
2017-04-19 10:04 ` Jiahuan Zhang
2017-04-19 10:09 ` Peter Maydell
2017-04-19 13:34 ` Jiahuan Zhang
2017-04-19 20:03 ` Peter Maydell
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=CAJy91Ca2FTvBzd2OqQZyEJBtCAxxosdcAFP1RMgGCQe2PJXEJA@mail.gmail.com \
--to=jiahuanzhang90@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).