From: Anthony Liguori <aliguori-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org>
To: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
tim.c.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Subject: Re: KVM performance
Date: Tue, 30 Jan 2007 09:11:50 -0600 [thread overview]
Message-ID: <45BF6036.8060704@cs.utexas.edu> (raw)
In-Reply-To: <1170161536.17669.10.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2467 bytes --]
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-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
[-- Attachment #2: virtbench-kvm.diff --]
[-- Type: text/x-patch, Size: 3265 bytes --]
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");
[-- Attachment #3: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
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
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
next prev parent reply other threads:[~2007-01-30 15:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-27 0:21 KVM performance Tim Chen
[not found] ` <1169857267.30807.44.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-01-27 3:11 ` Fabian Deutsch
2007-01-27 8:34 ` Avi Kivity
[not found] ` <45BB0E85.9060303-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-27 12:48 ` Rusty Russell
[not found] ` <1169902138.32208.25.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-01-28 9:40 ` Avi Kivity
[not found] ` <45BC6F98.908-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-30 12:52 ` Rusty Russell
[not found] ` <1170161536.17669.10.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-01-30 12:56 ` Avi Kivity
[not found] ` <45BF4082.3010803-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-31 1:54 ` Rusty Russell
2007-01-30 15:11 ` Anthony Liguori [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-11-14 18:35 Randy Broman
2008-11-14 18:58 ` David S. Ahern
2008-11-16 14:26 ` Avi Kivity
2008-11-16 22:08 ` Randy Broman
2008-11-17 14:50 ` Brian Jackson
2008-11-20 11:08 ` Avi Kivity
2009-04-03 11:32 BRAUN, Stefanie
2009-04-06 11:45 ` Avi Kivity
2009-04-06 12:13 ` Hauke Hoffmann
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=45BF6036.8060704@cs.utexas.edu \
--to=aliguori-nzps4cjig2hvqtjrzfazuq@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org \
--cc=tim.c.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
/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.