From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43824 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOtaX-00057r-OL for qemu-devel@nongnu.org; Wed, 16 Jun 2010 10:27:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOtaW-0001Ar-Q8 for qemu-devel@nongnu.org; Wed, 16 Jun 2010 10:27:33 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:35153) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOtaW-0001Aa-Ko for qemu-devel@nongnu.org; Wed, 16 Jun 2010 10:27:32 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o5GEKNes031398 for ; Wed, 16 Jun 2010 08:20:23 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o5GERJfC064626 for ; Wed, 16 Jun 2010 08:27:20 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o5GEREqL007945 for ; Wed, 16 Jun 2010 08:27:15 -0600 Message-ID: <4C18DF40.2050706@linux.vnet.ibm.com> Date: Wed, 16 Jun 2010 09:27:12 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH V4 2/3] qemu: Generic task offloading framework: threadlets References: <20100616115404.10988.62371.stgit@localhost.localdomain> <20100616115656.10988.96529.stgit@localhost.localdomain> <4C18C4C8.8090901@redhat.com> <20100616142236.GA20052@shareable.org> In-Reply-To: <20100616142236.GA20052@shareable.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Gautham R Shenoy , Qemu-development List , "Aneesh Kumar K.V" , Corentin Chary , Paolo Bonzini , Avi Kivity On 06/16/2010 09:22 AM, Jamie Lokier wrote: > Paolo Bonzini wrote: > >> These should be (at least for now) block-obj-$(CONFIG_POSIX). >> >> >>> + while (QTAILQ_EMPTY(&(queue->request_list))&& >>> + (ret != ETIMEDOUT)) { >>> + ret = qemu_cond_timedwait(&(queue->cond), >>> + &(queue->lock), 10*100000); >>> + } >>> >> Using qemu_cond_timedwait is a hack for not properly broadcasting the >> condvar in flush_threadlet_queue. >> > Are you sure? It looks like it also expires idle threads after a > fixed amount of idle time. > Yup, that's the intention of the code. We signal instead of broadcast because broadcasting causes all threads to wake up which hurts performance. AFAICT, there is no correctness issue in using signal vs. broadcast. Regards, Anthony Liguori > -- Jamie >