* [PATCH] Dump flush write performance
@ 2007-10-24 21:10 Ben Guthro
2007-10-25 14:32 ` Keir Fraser
0 siblings, 1 reply; 2+ messages in thread
From: Ben Guthro @ 2007-10-24 21:10 UTC (permalink / raw)
To: xen-devel; +Cc: Daniel Li
[-- Attachment #1: Type: text/plain, Size: 771 bytes --]
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@virtualron.com>
Signed-off-by: Daniel Li <dli@virtualiron.com>
[-- Attachment #2: xen-dump-flush-writes.patch --]
[-- Type: text/x-patch, Size: 760 bytes --]
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;
[-- 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] 2+ messages in thread* Re: [PATCH] Dump flush write performance
2007-10-24 21:10 [PATCH] Dump flush write performance Ben Guthro
@ 2007-10-25 14:32 ` Keir Fraser
0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2007-10-25 14:32 UTC (permalink / raw)
To: Ben Guthro, xen-devel; +Cc: Daniel Li
On 24/10/07 22:10, "Ben Guthro" <bguthro@virtualiron.com> wrote:
> 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.
I don't think we've had any reports of core dumping causing oom killer to
kick in. It seems a bit unlikely after all, unless you're really running
dom0 close to the wire. A user process write()ing a big file shouldn't be
able to trigger oom killer imo.
-- Keir
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-25 14:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 21:10 [PATCH] Dump flush write performance Ben Guthro
2007-10-25 14:32 ` Keir Fraser
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.