From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pat Campbell Subject: [PATCH] qemu xen-console, limit buffering Date: Mon, 30 Jun 2008 17:31:38 -0600 Message-ID: <48696CDA.70007@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030202050501090104080509" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------030202050501090104080509 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Running this script from within a PV guest without having an xm console attached can use all dom0 memory. while [ 1 ]; do ls -lR /usr > /dev/xvc0; done Start of script: (1% mem usage) PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 10281 root 15 0 76536 14m 2448 S 2 1.0 0:00.61 qemu-dm Couple minutes later: (17% mem usage) PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 10281 root 16 0 291m 231m 2448 R 15 17.0 0:16.34 qemu-dm Much later: (72.8% mem usage) PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 10281 root 15 0 1052m 989m 2448 S 10 72.8 1:13.25 qemu-dm Attached patch sets dom->buffer.max_capacity to xend configured limit. Please apply to xen-unstable tip. Signed-off-by: Pat Campbell --------------030202050501090104080509 Content-Type: text/x-patch; name="qemu-xenconsole-limit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-xenconsole-limit.patch" diff -r c33a40b4c22b tools/ioemu/hw/xen_console.c --- a/tools/ioemu/hw/xen_console.c Mon Jun 30 14:19:09 2008 +0100 +++ b/tools/ioemu/hw/xen_console.c Mon Jun 30 17:06:22 2008 -0600 @@ -160,16 +160,18 @@ int xs_gather(struct xs_handle *xs, cons static int domain_create_ring(struct domain *dom) { - int err, remote_port, ring_ref, rc; + int err, remote_port, ring_ref, limit, rc; err = xs_gather(dom->xsh, dom->serialpath, "ring-ref", "%u", &ring_ref, "port", "%i", &remote_port, + "limit", "%i", &limit, NULL); if (err) { err = xs_gather(dom->xsh, dom->conspath, "ring-ref", "%u", &ring_ref, "port", "%i", &remote_port, + "limit", "%i", &limit, NULL); if (err) { fprintf(stderr, "Console: failed to find ring-ref/port yet\n"); @@ -178,7 +180,9 @@ static int domain_create_ring(struct dom dom->use_consolepath = 1; } else dom->use_consolepath = 0; - fprintf(stderr, "Console: got ring-ref %d port %d\n", ring_ref, remote_port); + dom->buffer.max_capacity = limit; + fprintf(stderr, "Console: got ring-ref %d port %d limit %d\n", + ring_ref, remote_port, limit); if ((ring_ref == dom->ring_ref) && (remote_port == dom->remote_port)) goto out; --------------030202050501090104080509 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------030202050501090104080509--