From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35812 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOsWC-0007pK-68 for qemu-devel@nongnu.org; Wed, 16 Jun 2010 09:19:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOsW6-0003LH-47 for qemu-devel@nongnu.org; Wed, 16 Jun 2010 09:18:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3561) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOsW5-0003L1-St for qemu-devel@nongnu.org; Wed, 16 Jun 2010 09:18:54 -0400 Message-ID: <4C18CF32.2080300@redhat.com> Date: Wed, 16 Jun 2010 15:18:42 +0200 From: Paolo Bonzini MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH V4 0/3] qemu: Threadlets: A generic task offloading framework References: <20100616115404.10988.62371.stgit@localhost.localdomain> <4C18CD1D.5040600@codemonkey.ws> In-Reply-To: <4C18CD1D.5040600@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Avi Kivity , Qemu-development List , Corentin Chary , Gautham R Shenoy On 06/16/2010 03:09 PM, Anthony Liguori wrote: > On 06/16/2010 06:56 AM, Gautham R Shenoy wrote: >> Hi, >> >> This is the v4 of the patch-series to have a generic asynchronous task >> offloading framework (called threadlets) within qemu. > > Semantically, a threadlet is identical to a QEMUBH except that a QEMUBH > holds the qemu_mutex and a threadlet doesn't. > > I'd suggest naming these functions similar to QEMUBH to the point where > it makes sense to use the same structure. Instead of the normal > qemu_bh_schedule, I'd suggest having a qemu_bh_schedule_unlocked(). The API of threadlets is much more sensible than the one of bottom halves, especially with respect to allocation and possibility to use container_of instead of opaque. I think it's much more sensible to keep Gautham's proposed API and long term change all bottom halves to use threadlets. > Also, please introduce a short document in docs/ that gives a brief > overview of how to use unlocked bottom halves especially focusing on the > considerations with respect to what should and shouldn't be done in > these functions. This is a nice idea though. Paolo