All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu xen-console, limit buffering
@ 2008-06-30 23:31 Pat Campbell
  0 siblings, 0 replies; only message in thread
From: Pat Campbell @ 2008-06-30 23:31 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 895 bytes --]

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 <plc@novell.com>



[-- Attachment #2: qemu-xenconsole-limit.patch --]
[-- Type: text/x-patch, Size: 1211 bytes --]

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;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-30 23:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-30 23:31 [PATCH] qemu xen-console, limit buffering Pat Campbell

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.