From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FTPyv-0007TC-0W for qemu-devel@nongnu.org; Tue, 11 Apr 2006 17:01:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FTPyr-0007N9-Bw for qemu-devel@nongnu.org; Tue, 11 Apr 2006 17:00:59 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTPyq-0007M4-DZ for qemu-devel@nongnu.org; Tue, 11 Apr 2006 17:00:56 -0400 Received: from [204.127.200.83] (helo=sccrmhc13.comcast.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FTQ3m-000787-MU for qemu-devel@nongnu.org; Tue, 11 Apr 2006 17:06:02 -0400 Message-ID: <443C1906.3070305@win4lin.com> Date: Tue, 11 Apr 2006 17:00:54 -0400 From: "Leonardo E. Reiter" MIME-Version: 1.0 Subject: Re: [Qemu-devel] Network Performance between Win Host and Linux References: <6fe044190604111020h47108190x23983325567fb51c@mail.gmail.com> <200604111828.29361.paul@codesourcery.com> <6fe044190604111049j186d7c44oea9568ce1a8b54f3@mail.gmail.com> In-Reply-To: <6fe044190604111049j186d7c44oea9568ce1a8b54f3@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------000204040604080905030007" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------000204040604080905030007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Ken, please disregard my last mail on this... here's a current patch against today's CVS. I didn't realize that vl.c already converted from poll() to select(), so the patch logic is much easier and cleaner. Check it out... I tested it minimally and it seems to work - only tested it on Linux host, Leo P.S. you can apply this one with -p0 arg to patch. Kenneth Duda wrote: > Paul, thanks for the note. > > In my case, the guest CPU is idle. The host CPU utilization is only 5 > or 10 percent when running "find / -print > /dev/null" on the guest. > So I don't think guest interrupt latency is the issue for me in this > case. -- Leonardo E. Reiter Vice President of Product Development, CTO Win4Lin, Inc. Virtual Computing from Desktop to Data Center Main: +1 512 339 7979 Fax: +1 512 532 6501 http://www.win4lin.com --------------000204040604080905030007 Content-Type: text/x-patch; name="qemu-select-merge.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-select-merge.patch" Index: vl.c =================================================================== RCS file: /cvsroot/qemu/qemu/vl.c,v retrieving revision 1.168 diff -a -u -r1.168 vl.c --- vl.c 9 Apr 2006 01:32:52 -0000 1.168 +++ vl.c 11 Apr 2006 20:56:56 -0000 @@ -3952,8 +3952,11 @@ void main_loop_wait(int timeout) { IOHandlerRecord *ioh, *ioh_next; - fd_set rfds, wfds; + fd_set rfds, wfds, xfds; int ret, nfds; +#if defined(CONFIG_SLIRP) + int slirp_nfds; +#endif struct timeval tv; #ifdef _WIN32 @@ -3967,6 +3970,7 @@ nfds = -1; FD_ZERO(&rfds); FD_ZERO(&wfds); + FD_ZERO(&xfds); for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) { if (ioh->fd_read && (!ioh->fd_read_poll || @@ -3988,7 +3992,14 @@ #else tv.tv_usec = timeout * 1000; #endif - ret = select(nfds + 1, &rfds, &wfds, NULL, &tv); +#if defined(CONFIG_SLIRP) + if (slirp_inited) { + slirp_select_fill(&slirp_nfds, &rfds, &wfds, &xfds); + if (slirp_nfds > nfds) + nfds = slirp_nfds; + } +#endif + ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv); if (ret > 0) { /* XXX: better handling of removal */ for(ioh = first_io_handler; ioh != NULL; ioh = ioh_next) { @@ -4000,30 +4011,14 @@ ioh->fd_write(ioh->opaque); } } - } -#ifdef _WIN32 - tap_win32_poll(); -#endif - #if defined(CONFIG_SLIRP) - /* XXX: merge with the previous select() */ - if (slirp_inited) { - fd_set rfds, wfds, xfds; - int nfds; - struct timeval tv; - - nfds = -1; - FD_ZERO(&rfds); - FD_ZERO(&wfds); - FD_ZERO(&xfds); - slirp_select_fill(&nfds, &rfds, &wfds, &xfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv); - if (ret >= 0) { + if (slirp_inited) slirp_select_poll(&rfds, &wfds, &xfds); - } +#endif } + +#ifdef _WIN32 + tap_win32_poll(); #endif if (vm_running) { --------------000204040604080905030007--