All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] monitor: increase amount of data for monitor to read
@ 2017-05-02 13:47 Denis V. Lunev
  2017-05-02 14:34 ` Eric Blake
  2017-05-02 14:43 ` Markus Armbruster
  0 siblings, 2 replies; 20+ messages in thread
From: Denis V. Lunev @ 2017-05-02 13:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Denis V. Lunev, Markus Armbruster, Dr. David Alan Gilbert, Eric Blake

Right now QMP and HMP monitors read 1 byte at a time from the socket, which
is very inefficient. With 100+ VMs on the host this easily reasults in
a lot of unnecessary system calls and CPU usage in the system.

This patch changes the amount of data to read to 4096 bytes, which matches
buffer size on the channel level. Fortunately, monitor protocol is
synchronous right now thus we should not face side effects in reality.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Markus Armbruster <armbru@redhat.com>
CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
CC: Eric Blake <eblake@redhat.com>
---
 monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor.c b/monitor.c
index be282ec..00df5d0 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3698,7 +3698,7 @@ static int monitor_can_read(void *opaque)
 {
     Monitor *mon = opaque;
 
-    return (mon->suspend_cnt == 0) ? 1 : 0;
+    return (mon->suspend_cnt == 0) ? 4096 : 0;
 }
 
 static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-05-10 16:01 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02 13:47 [Qemu-devel] [PATCH 1/1] monitor: increase amount of data for monitor to read Denis V. Lunev
2017-05-02 14:34 ` Eric Blake
2017-05-02 14:44   ` Daniel P. Berrange
2017-05-02 14:49     ` Dr. David Alan Gilbert
2017-05-02 14:55       ` Daniel P. Berrange
2017-05-02 15:37   ` Denis V. Lunev
2017-05-02 14:43 ` Markus Armbruster
2017-05-02 15:29   ` Denis V. Lunev
2017-05-02 16:30     ` Markus Armbruster
2017-05-02 16:36       ` Dr. David Alan Gilbert
2017-05-02 16:48         ` Daniel P. Berrange
2017-05-02 17:00           ` Dr. David Alan Gilbert
2017-05-02 17:07           ` Denis V. Lunev
2017-05-03 11:29             ` Markus Armbruster
2017-05-03 11:34               ` Denis V. Lunev
2017-05-10 15:54                 ` Markus Armbruster
2017-05-10 16:01                   ` Denis V. Lunev
2017-05-03 11:35               ` Daniel P. Berrange
2017-05-03 11:39                 ` Denis V. Lunev
2017-05-03 11:55                 ` Marc-André Lureau

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.