From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46914 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGH2y-0006gL-Ok for qemu-devel@nongnu.org; Wed, 10 Nov 2010 15:13:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGH2x-0003hH-ME for qemu-devel@nongnu.org; Wed, 10 Nov 2010 15:13:32 -0500 Received: from mail-ey0-f173.google.com ([209.85.215.173]:39031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGH2x-0003h4-BR for qemu-devel@nongnu.org; Wed, 10 Nov 2010 15:13:31 -0500 Received: by eya25 with SMTP id 25so690378eya.4 for ; Wed, 10 Nov 2010 12:13:30 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20101110175442.GA2300@linux.vnet.ibm.com> References: <20101110131822.29714.34137.stgit@localhost6.localdomain6> <20101110131946.29714.98218.stgit@localhost6.localdomain6> <20101110175442.GA2300@linux.vnet.ibm.com> Date: Wed, 10 Nov 2010 20:13:29 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 1/3] Make paio subsystem use threadlets infrastructure From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arun@linux.vnet.ibm.com Cc: qemu-devel@nongnu.org On Wed, Nov 10, 2010 at 5:54 PM, Arun R Bharadwaj wrote: > * Stefan Hajnoczi [2010-11-10 13:45:29]: >> On Wed, Nov 10, 2010 at 1:19 PM, Arun R Bharadwaj >> wrote: >> I wonder if the condition variable has a measurable performance >> overhead. =A0We unconditionally broadcast on paiocb completion. =A0One >> idea would be to keep a counter of waiters (should only ever be 0 or >> 1) protected by aiocb_mutex and broadcast only when there is a waiter. >> =A0I just want to share this idea, I don't know if it's necessary to >> implement it or if it could even work without a race condition. >> > > I did not understand exactly why we are going to see a performane hit. > We will be doing a broadcast only after the aio_thread has finished > the work right? So how is this going to affect performance even if we > do a useless broadcast? If aio_thread() broadcasts before raising the signal then POSIX aio request completion is delayed by the time it takes to broadcast. I don't know if it matters though. Stefan