From: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
To: xen-devel <xen-devel@lists.xensource.com>
Cc: ospk-vm@lab.ntt.co.jp, Ian Pratt <ian.pratt@citrix.com>,
ian.jackson@eu.citrix.com,
Keir Fraser <keir.fraser@eu.citrix.com>
Subject: [RFC][PATCH 13/13] Kemari: use shared region with to flip logdirty_bitmap
Date: Fri, 06 Mar 2009 15:47:33 +0900 [thread overview]
Message-ID: <49B0C705.1030308@lab.ntt.co.jp> (raw)
In-Reply-To: <49B0B8DC.5000606@lab.ntt.co.jp>
This patch provides a shared memory to communicate between xc_kemari_save and
QEMU directly. The number of active logdirty_bitmap and condition are sent
through the shared memory.
Signed-off-by: Yoshisato Yanagisawa <yanagisawa.yoshisato@lab.ntt.co.jp>
Signed-off-by: Yoshi Tamura <tamura.yoshiaki@lab.ntt.co.jp>
---
xenstore.c | 62 ++++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 45 insertions(+), 17 deletions(-)
commit 3050ae2f8fffc2238a9e763b2534f3778b1bb372
Author: Yoshisato YANAGISAWA <yanagisawa@osrg.net>
Date: Thu Feb 26 14:25:40 2009 +0900
Add features required for Kemari.
diff --git a/xenstore.c b/xenstore.c
index ac91e20..9d5f94f 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -593,6 +593,7 @@ int xenstore_fd(void)
unsigned long *logdirty_bitmap = NULL;
unsigned long logdirty_bitmap_size;
extern int vga_ram_size, bios_size;
+extern volatile int kemari_enabled;
void xenstore_process_logdirty_event(void)
{
@@ -600,6 +601,8 @@ void xenstore_process_logdirty_event(void)
static char *active_path = NULL;
static char *next_active_path = NULL;
static char *seg = NULL;
+ static char *kemari_qemu_info = NULL;
+ static char *qemu_file = NULL;
unsigned int len;
int i;
@@ -666,6 +669,8 @@ void xenstore_process_logdirty_event(void)
seg = NULL;
return;
}
+ kemari_qemu_info = seg + logdirty_bitmap_size * 2;
+ asprintf(&qemu_file, "/dev/shm/qemu-save.%d", domid); /* use tmpfs */
#endif
/* Remember the paths for the next-active and active entries */
@@ -683,26 +688,49 @@ void xenstore_process_logdirty_event(void)
}
}
- fprintf(logfile, "Triggered log-dirty buffer switch\n");
+ if (kemari_enabled) {
+ while (kemari_qemu_info[1])
+ xen_rmb();
+
+ /* Switch buffers */
+ i = kemari_qemu_info[0];
+ if (i != 0 && i != 1) {
+ fprintf(logfile, "Log-dirty: bad next-active entry: %s\n", act);
+ exit(1);
+ }
+ logdirty_bitmap = (unsigned long *)(seg + i * logdirty_bitmap_size);
+ kemari_qemu_info[1] = 1;
+ xen_wmb();
+
+ /* Save QEMU status */
+ while (kemari_qemu_info[2])
+ xen_rmb();
+ do_savevm(qemu_file);
+ kemari_qemu_info[2] = 1;
+ xen_wmb();
+ } else {
+
+ fprintf(logfile, "Triggered log-dirty buffer switch\n");
- /* Read the required active buffer from the store */
- act = xs_read(xsh, XBT_NULL, next_active_path, &len);
- if (!act) {
- fprintf(logfile, "Log-dirty: can't read next-active\n");
- exit(1);
- }
+ /* Read the required active buffer from the store */
+ act = xs_read(xsh, XBT_NULL, next_active_path, &len);
+ if (!act) {
+ fprintf(logfile, "Log-dirty: can't read next-active\n");
+ exit(1);
+ }
- /* Switch buffers */
- i = act[0] - '0';
- if (i != 0 && i != 1) {
- fprintf(logfile, "Log-dirty: bad next-active entry: %s\n", act);
- exit(1);
- }
- logdirty_bitmap = (unsigned long *)(seg + i * logdirty_bitmap_size);
+ /* Switch buffers */
+ i = act[0] - '0';
+ if (i != 0 && i != 1) {
+ fprintf(logfile, "Log-dirty: bad next-active entry: %s\n", act);
+ exit(1);
+ }
+ logdirty_bitmap = (unsigned long *)(seg + i * logdirty_bitmap_size);
- /* Ack that we've switched */
- xs_write(xsh, XBT_NULL, active_path, act, len);
- free(act);
+ /* Ack that we've switched */
+ xs_write(xsh, XBT_NULL, active_path, act, len);
+ free(act);
+ }
}
next prev parent reply other threads:[~2009-03-06 6:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-06 5:47 [RFC][PATCH 00/13] Kemari: VM synchronization mechanism for fault tolerance Yoshiaki Tamura
2009-03-06 5:50 ` [RFC][PATCH 01/13] Kemari: add ECS_TAP state to event channel Yoshiaki Tamura
2009-03-06 5:53 ` [RFC][PATCH 02/13] Kemari: core kemari code Yoshiaki Tamura
2009-03-06 5:54 ` [RFC][PATCH 03/13] Kemari: change parameter type of xc_{set, get}_hvm_param Yoshiaki Tamura
2009-03-06 5:56 ` [RFC][PATCH 04/13] Kemari: Kemari controller interface in libxc Yoshiaki Tamura
2009-03-06 6:26 ` [RFC][PATCH 05/13] Kemari: Kemari sender Yoshiaki Tamura
2009-03-06 6:46 ` [RFC][PATCH 06/13] Kemari: Kemari receiver Yoshiaki Tamura
2009-03-06 6:46 ` [RFC][PATCH 07/13] Kemari: add Kemari support to python Yoshiaki Tamura
2009-03-06 6:46 ` [RFC][PATCH 08/13] Kemari: add dev state "Attached" " Yoshiaki Tamura
2009-03-06 6:47 ` [RFC][PATCH 09/13] Kemari: add XenbusStateAttached to xenbus Yoshiaki Tamura
2009-03-06 6:47 ` [RFC][PATCH 10/13] Kemari: XenbusStateAttached handler for blkback Yoshiaki Tamura
2009-03-06 6:47 ` [RFC][PATCH 11/13] Kemari: XenbusStateAttached handler for netback Yoshiaki Tamura
2009-03-06 6:47 ` [RFC][PATCH 12/13] Kemari: use signal to save qemu state for Kemari Yoshiaki Tamura
2009-03-06 11:39 ` Stefano Stabellini
2009-03-06 16:20 ` Yoshiaki Tamura
2009-03-17 17:55 ` Stefano Stabellini
2009-03-17 18:21 ` Ian Jackson
2009-03-17 18:35 ` Stefano Stabellini
2009-03-18 9:11 ` Yoshiaki Tamura
2009-03-18 9:34 ` Keir Fraser
2009-03-18 12:45 ` Yoshiaki Tamura
2009-03-18 12:46 ` Stefano Stabellini
2009-03-18 13:06 ` Keir Fraser
2009-03-19 5:54 ` Yoshiaki Tamura
2009-03-18 17:37 ` Christopher Head
2009-03-19 6:07 ` Yoshiaki Tamura
2009-03-16 18:05 ` Ian Jackson
2009-03-06 6:47 ` Yoshiaki Tamura [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-03-12 1:14 [RFC][PATCH 00/13] Kemari: updated to the 3.4 unstable tree Yoshiaki Tamura
2009-03-12 1:23 ` [RFC][PATCH 13/13] Kemari: use shared region with to flip logdirty_bitmap Yoshiaki Tamura
2009-03-24 6:59 ` Yoshiaki Tamura
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49B0C705.1030308@lab.ntt.co.jp \
--to=tamura.yoshiaki@lab.ntt.co.jp \
--cc=ian.jackson@eu.citrix.com \
--cc=ian.pratt@citrix.com \
--cc=keir.fraser@eu.citrix.com \
--cc=ospk-vm@lab.ntt.co.jp \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.