From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Vivier Subject: Re: [ANNOUNCE] kvm-14 release Date: Thu, 22 Feb 2007 17:35:13 +0100 Message-ID: <45DDC641.3030001@bull.net> References: <45D98390.6060001@qumranet.com> <45DA25D9.1060509@aurel32.net> <45DA9FFA.2020009@qumranet.com> <45DB7514.3040409@aurel32.net> <45DBFD6E.2060507@qumranet.com> <45DC51E3.7010205@aurel32.net> <45DC54B5.9080608@qumranet.com> <45DC5D4E.5000300@bull.net> <45DC65C9.6010104@codemonkey.ws> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0516759194==" Cc: kvm-devel To: Anthony Liguori Return-path: In-Reply-To: <45DC65C9.6010104-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============0516759194== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD707D87F4C7A4C089BB1CF72" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD707D87F4C7A4C089BB1CF72 Content-Type: multipart/mixed; boundary="------------020804090505060406020406" This is a multi-part message in MIME format. --------------020804090505060406020406 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Anthony Liguori wrote: > Laurent Vivier wrote: >> Avi Kivity wrote: >> =20 >>> Aurelien Jarno wrote: >>> =20 >>>> =20 >>>> =20 >>>>> What is your disk image file format, or are you using a partition? >>>>> =20 >>>>> =20 >>>> I am using a raw image file on an ext3 partition. >>>> >>>> =20 >>>> =20 >>>>> Do the results change (on kvm-14) if you pin the guest to a core wi= th=20 >>>>> 'taskset 1 qemu ...' >>>>> =20 >>>>> =20 >>>> Bingo. It now works even faster than kvm-13! >>>> >>>> real 0m22.307s >>>> user 0m13.935s >>>> sys 0m4.720 >>>> >>>> =20 >>>> =20 >>> I'm guessing this is due to the glibc aio implementation, which uses = >>> threads instead of true aio. The threads may cause the vcpu to migra= te=20 >>> frequently from one code to another. >>> >>> There are two possible solutions: >>> >>> - use native aio from http://www.bullopensource.org/posix/. I think= =20 >>> the aio signal patches are not yet in, so this may not work. >>> - teach the scheduler about the cost of migrating vcpus >>> The first approach will solve itself eventually, though slowly if the= =20 >>> current slow rate of aio merging continues. We'll have to do the sec= ond. >>> >>> =20 >> if you prefer the first one, S=E9bastien will release very soon aio pa= tches for >> 2.6.20 with an up-to-date libposix-aio. >> =20 >=20 > Hi Laurent, >=20 > I gave that a shot a little bit ago. Ran into two problems. >=20 > 1) Couldn't avoid linking to -lrt as QEMU uses time functions from it. > 2) While I could get things compiling (with patches), QEMU would SEGV=20 > almost immediately. >=20 > Could you guys maybe give compiling QEMU w/libposix-aio a shot? I'm=20 > really interested to see if it makes a difference. >=20 > Regards, >=20 > Anthony Liguori >=20 >> [advertising] Keep an eye on the bullopensource website. [/advertising= ] >> :-P >> >> Regards, >> Laurent OK, I didn' have time to test the performance of the result, but you can = find attached some patches to enable libposix-aio with kvm-14. first take last patches for linux-2.6.20 and libposix-aio-.0.8.2 from web= site : http://sourceforge.net/projects/paiol if you are using AMD64, you must patch libposix-aio because there is a li= ttle problem remaining to detect lio_submit syscall (first attachment) then apply following patch to kvm-14 (second attachment). It works fine on my system except when I use "-hda /dev/sdb" : qemu crash= es just after mounting filesystems when "init" tries to set kernel parameters wit= h "sysctl" (I use a debian 4.0). If I boot in emergency mode, mounting manu= ally filesystems and running manually sysctl, all works fine. It looks like a synchronization problem. There are remaining issues : libposix-aio uses kernel AIO, so files must = be opened using O_DIRECT and buffers must be aligned. libposix-aio is able t= o manage other cases but this has a performance cost. Aur=E9lien, do you have any time to test this on your system ? Regards, Laurent --=20 ------------- Laurent.Vivier-6ktuUTfB/bM@public.gmane.org -------------- "Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke --------------020804090505060406020406 Content-Type: text/plain; name="configure_ac-x86_64.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="configure_ac-x86_64.patch" --- libposix-aio-0.8.2-org/configure.ac 2007-02-21 15:58:43.000000000 +01= 00 +++ libposix-aio-0.8.2/configure.ac 2007-02-22 09:43:39.000000000 +0100 @@ -217,6 +217,24 @@ =20 # test if kernel supports signal on LIO completion =20 +case $host_cpu in + + x86_64*) + lio_submit_syscall=3D280 + ;; + =20 + i386*) + lio_submit_syscall=3D320 + ;; + *) + AC_MSG_WARN(unknown syscall number for lio_submit) + lio_submit_syscall=3D + ;; +esac + +if test "${lio_submit_syscall}" !=3D "" +then + AC_ARG_ENABLE( [lio-signal], [AS_HELP_STRING(--enable-lio-signal, @@ -236,7 +254,7 @@ =20 #define IO_CMD_PWRITE 1 =20 -#define SYS_lio_submit 320 +#define SYS_lio_submit ${lio_submit_syscall} =20 #define LIO_WAIT 0 #define LIO_NOWAIT 1 @@ -397,7 +415,7 @@ =20 #define IO_CMD_PWRITE 1 =20 -#define SYS_lio_submit 320 +#define SYS_lio_submit ${lio_submit_syscall} =20 #define LIO_WAIT 0 #define LIO_NOWAIT 1 @@ -514,6 +532,7 @@ Define to 1 if kernel supports LIO wait)],[ac_lio_wait=3Dno AC_MSG_RESULT(no) ],[])) +fi # end of test lio_submit_syscall =20 # check for support of fd for io_cancel =20 --------------020804090505060406020406 Content-Type: text/plain; name="posixaio.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="posixaio.diff" Index: kvm-14/configure =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm-14.orig/configure 2007-02-22 11:46:09.000000000 +0100 +++ kvm-14/configure 2007-02-22 11:46:55.000000000 +0100 @@ -87,7 +87,7 @@ --enable-kvm --kernel-path=3D"$libkvm_kerneldir" \ --enable-alsa \ ${disable_gcc_check:+"--disable-gcc-check"} \ - --prefix=3D"$prefix" + --prefix=3D"$prefix" --enable-libposix-aio ) =20 =20 Index: kvm-14/qemu/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm-14.orig/qemu/Makefile 2007-02-22 11:46:09.000000000 +0100 +++ kvm-14/qemu/Makefile 2007-02-22 11:46:12.000000000 +0100 @@ -27,10 +27,14 @@ ifndef CONFIG_DARWIN ifndef CONFIG_WIN32 ifndef CONFIG_SOLARIS +ifdef USE_LIBPOSIX_AIO +LIBS+=3D-lposix-aio +else LIBS+=3D-lrt endif endif endif +endif =20 all: $(TOOLS) $(DOCS) recurse-all =20 Index: kvm-14/qemu/Makefile.target =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm-14.orig/qemu/Makefile.target 2007-02-22 11:46:09.000000000 +0100 +++ kvm-14/qemu/Makefile.target 2007-02-22 11:46:12.000000000 +0100 @@ -452,7 +452,11 @@ ifndef CONFIG_DARWIN ifndef CONFIG_WIN32 ifndef CONFIG_SOLARIS -VL_LIBS=3D-lutil -lrt -luuid +VL_LIBS=3D-lutil +ifdef USE_LIBPOSIX_AIO +VL_LIBS+=3D-lposix-aio +endif +VL_LIBS+=3D-lrt -luuid endif endif endif Index: kvm-14/qemu/block-raw.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm-14.orig/qemu/block-raw.c 2007-02-22 11:46:09.000000000 +0100 +++ kvm-14/qemu/block-raw.c 2007-02-22 11:46:12.000000000 +0100 @@ -197,7 +197,7 @@ act.sa_handler =3D aio_signal_handler; sigaction(aio_sig_num, &act, NULL); =20 -#if defined(__GLIBC__) && defined(__linux__) +#if defined(__GLIBC__) && defined(__linux__) && !defined(USE_LIBPOSIX_AI= O) { /* XXX: aio thread exit seems to hang on RedHat 9 and this init seems to fix the problem. */ Index: kvm-14/qemu/configure =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm-14.orig/qemu/configure 2007-02-22 11:46:09.000000000 +0100 +++ kvm-14/qemu/configure 2007-02-22 11:46:12.000000000 +0100 @@ -99,6 +99,7 @@ linux_user=3D"no" darwin_user=3D"no" build_docs=3D"no" +libposix_aio=3D"no" uname_release=3D"" =20 # OS specific @@ -262,6 +263,8 @@ ;; --enable-uname-release=3D*) uname_release=3D"$optarg" ;; + --enable-libposix-aio) libposix_aio=3D"yes" + ;; esac done =20 @@ -312,6 +315,7 @@ echo " --fmod-lib path to FMOD library" echo " --fmod-inc path to FMOD includes" echo " --enable-uname-release=3DR Return R for uname -r in usermode emu= lation" +echo " --enable-libposix-aio use libposix-aio instead of glibc aio" echo "" echo "NOTE: The object files are built at the place where configure is l= aunched" exit 1 @@ -635,6 +639,7 @@ echo "kqemu support $kqemu" echo "kvm support $kvm" echo "Documentation $build_docs" +echo "libposix-aio $libposix_aio" [ ! -z "$uname_release" ] && \ echo "uname -r $uname_release" =20 @@ -795,6 +800,8 @@ echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h echo "#define _BSD 1" >> $config_h fi +echo "USE_LIBPOSIX_AIO=3Dyes" >> $config_mak +echo "#define USE_LIBPOSIX_AIO 1" >> $config_h =20 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h =20 --------------020804090505060406020406-- --------------enigD707D87F4C7A4C089BB1CF72 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.7 (GNU/Linux) iD8DBQFF3cZF9Kffa9pFVzwRAqR4AKC1FiQNnYAgK8umv678yMTjgMU+PACfYGEa 0hVHpu9H6Bkdxexb8Nfkaww= =w1kD -----END PGP SIGNATURE----- --------------enigD707D87F4C7A4C089BB1CF72-- --===============0516759194== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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 --===============0516759194== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============0516759194==--