WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel][PATCH] qemu xen-console, limit buffering

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel][PATCH] qemu xen-console, limit buffering
From: Pat Campbell <plc@xxxxxxxxxx>
Date: Mon, 30 Jun 2008 17:31:38 -0600
Delivery-date: Mon, 30 Jun 2008 16:35:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.6 (X11/20070801)
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@xxxxxxxxxx>


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;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel][PATCH] qemu xen-console, limit buffering, Pat Campbell <=