From: Gerd Hoffmann <kraxel@redhat.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: fred.konrad@greensocs.com, qemu-devel@nongnu.org,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic
Date: Tue, 02 Apr 2013 11:18:43 +0200 [thread overview]
Message-ID: <515AA273.1000109@redhat.com> (raw)
In-Reply-To: <515295A1.8030705@linux.vnet.ibm.com>
On 03/27/13 07:45, Wenchao Xia wrote:
> Hi, Luiz
> Personally I hope reduce the dynamic allocated buffer which brings
> fragments and unexpected memory grow.
It's a tradeoff. We can reduce the dynamic allocation, by simply
reusing the qstring instead of allocation a new one (after
complete/partial write). At the cost of wasting some memory.
Given that qstrings grow expotentially I think the dynamic allocation
overhead isn't that bad.
> Instead, how about sacrifice
> some time to wait output complete, since monitor is not time critical?
The watch added recently will fire when there is space for writing.
Right now it will write out the next chunk from the buffer.
In theory we could change the monitor code to continue generating the
response when there is more output space, so we don't have to buffer it
in the first place. But I think the complexity simply isn't worth it
for the memory savings we can gain.
cheers,
Gerd
next prev parent reply other threads:[~2013-04-02 9:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 19:40 [Qemu-devel] [PATCH 0/2] Monitor: make output buffer dynamic Luiz Capitulino
2013-03-25 19:40 ` [Qemu-devel] [PATCH 1/2] qstring: add qobject_get_length() Luiz Capitulino
2013-04-09 3:02 ` Hu Tao
2013-04-09 12:38 ` Luiz Capitulino
2013-03-25 19:40 ` [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic Luiz Capitulino
2013-03-25 21:07 ` Paolo Bonzini
2013-03-25 21:44 ` Luiz Capitulino
2013-03-27 6:45 ` Wenchao Xia
2013-03-27 12:27 ` Luiz Capitulino
2013-03-28 3:21 ` Wenchao Xia
2013-04-02 9:18 ` Gerd Hoffmann [this message]
2013-04-02 9:19 ` [Qemu-devel] [PATCH 0/2] Monitor: make " Gerd Hoffmann
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=515AA273.1000109@redhat.com \
--to=kraxel@redhat.com \
--cc=fred.konrad@greensocs.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiawenc@linux.vnet.ibm.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).