Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EKEgg-0002rR-HV for qemu-devel@nongnu.org; Tue, 27 Sep 2005 08:35:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EKEge-0002qq-1h for qemu-devel@nongnu.org; Tue, 27 Sep 2005 08:35:57 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EKEgJ-0002ND-U9 for qemu-devel@nongnu.org; Tue, 27 Sep 2005 08:35:36 -0400 Received: from [12.124.108.50] (helo=dash.soliddesign.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EKEUI-0006DQ-EH for qemu-devel@nongnu.org; Tue, 27 Sep 2005 08:23:10 -0400 Received: from fred.ofc.soliddesign.net (fred.ofc.soliddesign.net [10.2.3.250]) by dash.soliddesign.net (Postfix) with ESMTP id BAF6E4EACF for ; Tue, 27 Sep 2005 07:23:16 -0500 (EST) Subject: Re: [Qemu-devel] [patch] IDE busmaster DMA support From: Joe Batt In-Reply-To: <4338A4E9.5030308@stanfordalumni.org> References: <4338A4E9.5030308@stanfordalumni.org> Content-Type: text/plain Date: Tue, 27 Sep 2005 07:23:16 -0500 Message-Id: <1127823796.7015.12.camel@fred.ofc.soliddesign.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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 On Mon, 2005-09-26 at 21:48 -0400, John Coiner wrote: > Can anyone shed light on the potential performance to be realized? For > example, how long does a context switch take in the guest? If it takes > 10ms (one disk seek) then there's probably no benefit to concurrent disk > IO. If a context switch takes 1ms, then the guest has opportunity to > make forward progress while awaiting an IDE interrupt. I ran this code to time context switches: #include #include #include #include #include #include int main(int argc, char *argv[]) { struct timeval start; gettimeofday(&start, NULL); int fd[2]; pipe(fd); int child = fork(); int i, count = 100000; char *msg = malloc(2); strcpy(msg, "m"); for (i = 0; i < count; i++) { if (child) { if (write(fd[1], msg, 1) != 1) fprintf(stderr, "FAILURE\n"); } else { if (read(fd[0], msg, 1) != 1) fprintf(stderr, "FAILURE\n"); } } struct timeval end; gettimeofday(&end, NULL); printf("%g microseconds/context switch\n", (((end.tv_sec - start.tv_sec) * (double)1000000) + end.tv_usec - start.tv_usec)/count); return 0; } On my dual 2.4 Ghz Xeon, I get the following timings. host:~ > ./yieldtest 2.35418 microseconds/context switch 2.35414 microseconds/context switch KNOPPIX guest: > ./yieldtest 105.092 microseconds/context switch 105.184 microseconds/context switch Is that what you are after? -- Joe Batt