Rusty Russell wrote:
On Sun, 2007-01-28 at 11:40 +0200, Avi Kivity wrote:
Rusty Russell wrote:
I use virtbench (http://ozlabs.org/~rusty/virtbench) to try
to measure optimization results; it still needs more tests (and an
explicit kvm backend).
A kvm backend would be appreciated.
Yes, and patches are most welcome 8) Actually, I'll work on this week.
Attached patch was my initial attempt. I wanted it to work with mostly
unmodified guest images so the only requirement is that a getty is
spawned on ttyS0. I ran in to quite a few problems with virtbench
though once I started launching multiple guests and haven't gotten
around to debugging those yet.
Regards,
Anthony Liguori
- after modifying a pte, kvm doesn't preload the modified pte into
shadow, but instead lets the guest fault it in
lguest doesn't either, but don't you still want the fault to update the
host accessed bit?
The story here is that the guest is handling a pagefault and writing the
new guest pte. kvm traps the write (guest pagetables are write
protected), and has the option of updating the shadow pte to reflect the
guest pte.
The clever guest kernel will set the accessed bit (and the dirty bit on
writable ptes) to avoid an rmw cycle by the hardware pagetable walker.
[two instrumented runs later]
Both Linux and Windows seem to do this optimization.
Right. This (trivial!) optimization wins lguest a good 10%:
Before:
Time for one Copy-on-Write fault: 13622 nsec
Time to exec client once: 1085481 nsec
Time for one fork/exit/wait: 700796 nsec
After:
Time for one Copy-on-Write fault: 12036 nsec
Time to exec client once: 969899 nsec
Time for one fork/exit/wait: 664601 nsec
Thanks!
Rusty.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel
diff -r 03813abef33e kvm/SETTINGS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/kvm/SETTINGS Mon Jan 15 15:50:09 2007 -0600
@@ -0,0 +1,3 @@
+# Sources from all scripts
+ROOT_FILE="/mnt/FC-5-i386.img"
+QEMU=qemu
diff -r 03813abef33e kvm/serial.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/kvm/serial.py Mon Jan 15 16:00:13 2007 -0600
@@ -0,0 +1,58 @@
+import sys, socket, binascii, commands
+
+if len(sys.argv) != 9:
+ print 'Usage: serial IP PORT LOGIN PASSWORD PATH ID IP PORT'
+ sys.exit(1)
+
+sys.stderr.write('foo\n')
+
+login='login: '
+password='Password: '
+prompt=']# '
+
+s = socket.socket(socket.AF_INET)
+s.connect((sys.argv[1], int(sys.argv[2])))
+
+def wait_for(string):
+ buf = ''
+ while True:
+ f = s.recv(4096)
+ buf += f
+ if buf.endswith(string):
+ break
+
+s.sendall('\n')
+wait_for(login)
+s.sendall('%s\n' % sys.argv[3])
+
+wait_for(password)
+s.sendall('%s\n' % sys.argv[4])
+
+wait_for(prompt)
+status, output = commands.getstatusoutput('uuencode %s /tmp/virtclient' %
+ sys.argv[5])
+
+f = open(sys.argv[5])
+d = binascii.b2a_base64(f.read())
+f.close()
+
+s.sendall("stty -echo\n")
+wait_for(prompt)
+
+s.sendall("cat > /tmp/virtclient.b64 <<EOF\n")
+s.sendall(d)
+s.sendall("\nEOF\n")
+wait_for(prompt)
+
+s.sendall("""python
+import sys, binascii
+i = open('/tmp/virtclient.b64', 'r')
+f = open('/tmp/virtclient', 'w')
+f.write(binascii.a2b_base64(i.read()))
+sys.exit(0)
+""")
+wait_for(prompt)
+s.sendall('chmod 755 /tmp/virtclient\n')
+wait_for(prompt)
+s.sendall('/tmp/virtclient %s %s %s\n' % (sys.argv[6], sys.argv[7], sys.argv[8]))
+wait_for(prompt)
diff -r 03813abef33e kvm/start
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/kvm/start Mon Jan 15 11:56:18 2007 -0600
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+set -e
+
+. kvm/SETTINGS
+
+#if grep AuthenticAMD 2>/dev/null ; then
+# modules="kvm kvm-amd"
+#else
+# modules="kvm kvm-intel"
+#fi
+
+#[ -c /dev/kvm ] || modprobe $modules
diff -r 03813abef33e kvm/start_machine
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/kvm/start_machine Sat Jan 27 11:09:40 2007 -0600
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. kvm/SETTINGS
+
+serial_port=$((1025 + $1))
+
+$QEMU -m 128 -hda "${ROOT_FILE}" -snapshot -serial tcp:localhost:${serial_port},server,nowait -kernel-kqemu &
+sleep 2
+python kvm/serial.py 127.0.0.1 ${serial_port} root ibm4xen virtclient $1 $2 $3 &
+jobs -p %1
diff -r 03813abef33e kvm/stop
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/kvm/stop Mon Jan 15 11:32:55 2007 -0600
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+. kvm/SETTINGS
+exit 0
diff -r 03813abef33e kvm/stop_machine
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/kvm/stop_machine Mon Jan 15 11:43:29 2007 -0600
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+. kvm/SETTINGS
+
+kill $1
diff -r 03813abef33e server.c
--- a/server.c Thu Jan 11 13:56:30 2007 +1100
+++ b/server.c Mon Jan 15 16:02:11 2007 -0600
@@ -227,7 +227,7 @@ static struct sockaddr_in get_server_add
socklen_t socklen = sizeof(saddr);
/* This assumes we have an eth0. */
- strcpy(ifr.ifr_name, "eth0");
+ strcpy(ifr.ifr_name, "ath0");
sin->sin_family = AF_INET;
if (ioctl(sock, SIOCGIFADDR, &ifr) != 0)
err(1, "Getting interface address for eth0");
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel