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] Dump flush write performance

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Dump flush write performance
From: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Date: Wed, 24 Oct 2007 17:10:23 -0400
Cc: Daniel Li <dli@xxxxxxxxxxxxxxx>
Delivery-date: Wed, 24 Oct 2007 14:21:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.5 (X11/20070719)
Two changes to avoid disk driver using up kernel memory and triggering oom-killer
while creating guest dump to a disk file:

1) Decreased write chunks from 16MB to 2MB;
2) Flush (fsync) after each 2MB write.

To make sure we don't suffer significant write performance penalty, each of the following cases have been tested several times to dump a 1GB guest to a file on
a SAN disk:

With current code (16MB writes, sync once after all writes); ~38s
16MB writes, sync after each write: ~46s
2MB writes, sync after each write: ~49s

Sync-often costs us about 20%, smaller-write-size costs another 8%. The total is
less than 30% and about 10 seconds more for a 1GB guest.

Signed-off-by: Ben Guthro <bguthro@xxxxxxxxxxxxxx>
Signed-off-by: Daniel Li <dli@xxxxxxxxxxxxxxx>
diff -r 9d263e1fcd02 tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c     Wed Oct 24 16:25:11 2007 -0400
+++ b/tools/libxc/xc_core.c     Wed Oct 24 16:26:04 2007 -0400
@@ -56,7 +56,7 @@
 #include <unistd.h>
 
 /* number of pages to write at a time */
-#define DUMP_INCREMENT (4 * 1024)
+#define DUMP_INCREMENT (512)
 
 /* Don't yet support cross-address-size core dump */
 #define guest_width (sizeof (unsigned long))
@@ -875,7 +875,7 @@ static int local_file_dump(void *args, c
     if (length >= DUMP_INCREMENT*PAGE_SIZE) {
         // Now dumping pages -- make sure we discard clean pages from
         // the cache after each write
-        discard_file_cache(da->fd, 0 /* no flush */);
+        discard_file_cache(da->fd, 1 /* flush */);
     }
 
     return 0;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>