From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMDOM-0002GZ-4B for qemu-devel@nongnu.org; Mon, 03 Aug 2015 06:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMDOG-0006ep-SE for qemu-devel@nongnu.org; Mon, 03 Aug 2015 06:54:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMDOG-0006eh-N8 for qemu-devel@nongnu.org; Mon, 03 Aug 2015 06:54:44 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id F3B3CA380F for ; Mon, 3 Aug 2015 10:54:43 +0000 (UTC) Date: Mon, 3 Aug 2015 18:54:41 +0800 From: Fam Zheng Message-ID: <20150803105441.GC30561@ad.nay.redhat.com> References: <20150731174542.44862e3a@markmb_rh> <20150803030906.GA13938@ad.nay.redhat.com> <20150803095238.663a7bee@markmb_rh> <20150803082234.GA30561@ad.nay.redhat.com> <20150803110147.55ede584@markmb_rh> <20150803092457.GB30561@ad.nay.redhat.com> <20150803122204.4774bb38@markmb_rh> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20150803122204.4774bb38@markmb_rh> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Modularizing QEMU RFC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marc =?iso-8859-1?Q?Mar=ED?= Cc: qemu-devel On Mon, 08/03 12:22, Marc Mar=ED wrote: > On Mon, 3 Aug 2015 17:24:57 +0800 > Fam Zheng wrote: >=20 > > On Mon, 08/03 11:01, Marc Mar=ED wrote: > > > Some profiling: > > >=20 > > > A QEMU with this configuration: > > > ./configure --enable-sparse --enable-sdl --enable-gtk --enable-vte = \ > > > --enable-curses --enable-vnc --enable-vnc-{jpeg,tls,sasl,png,ws} \ > > > --enable-virtfs --enable-brlapi --enable-curl --enable-fdt \ > > > --enable-bluez --enable-kvm --enable-rdma --enable-uuid > > > --enable-vde \ --enable-linux-aio --enable-cap-ng --enable-attr > > > --enable-vhost-net \ --enable-vhost-scsi --enable-spice > > > --enable-rbd --enable-libiscsi \ --enable-smartcard-nss > > > --enable-guest-agent --enable-libusb \ --enable-usb-redir > > > --enable-lzo --enable-snappy --enable-bzip2 \ --enable-seccomp > > > --enable-coroutine-pool --enable-glusterfs \ --enable-tpm > > > --enable-libssh2 --enable-vhdx --enable-quorum \ --enable-numa > > > --enable-tcmalloc --target-list=3Dx86_64-softmmu > > >=20 > > > Has dependencies on 142 libraries. It takes 60 ms between the run > > > and the jump to the main function, and 80 ms between the run and th= e > > > first kvm_entry. > > >=20 > > > A QEMU with the same configuration and --enable-modules has > > > dependencies on 125 libraries. It takes 20 ms between the run and > > > the jump to the main function, and 100 ms between the run and the > > > first kvm_entry. > >=20 > > Which means 40 ms is saved because we reduced the size and dependency > > of QEMU executable, but 60 ms is the extra cost of dynamical loading. > > That's a net loss. > >=20 > > In your --enable-modules configuration, could you try comment out > > module_load body and compare again, so we know how much time is spent > > in looking up and loading modules? > >=20 >=20 > With the module load disabled, 20 ms from run to main, and 40 ms from > run to kvm_entry. Which is "the expected", from the numbers above. >=20 Thanks, that proves the 40 ms speeding up is already waving hands. :) Once you figure out a way to map protocol/format names to module names in block.c, we can review all "QLIST_FOREACH(drv, &bdrv_drivers, list)" ther= e, to either inject loading of all modules, or change it to loading of a specif= ic module. Fam