Re: [Qemu-devel] [PATCH 5/7] coroutine: rewrite pool to avoid mutex

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 19:34, Kevin Wolf wrote: >>> > > Not sure if speculations about the future belong into commit messages, >>> > > but while it may turn out that a bypass is required in the end (I hope >>> > > it doesn't), the part about AIOCBs is wrong if you really consistently >>> > > use coroutine

Re: [Qemu-devel] [PATCH 5/7] coroutine: rewrite pool to avoid mutex

2014-11-28 Thread Kevin Wolf
Am 28.11.2014 um 18:31 hat Paolo Bonzini geschrieben: > > > On 28/11/2014 17:40, Kevin Wolf wrote: > >> > I still believe we will end with some kind of coroutine bypass scheme > >> > (even coroutines _do_ allocate an AIOCB, so calling bdrv_aio_readv > >> > directly can help), but hey it cannot hu

Re: [Qemu-devel] [PATCH 5/7] coroutine: rewrite pool to avoid mutex

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 17:40, Kevin Wolf wrote: >> > I still believe we will end with some kind of coroutine bypass scheme >> > (even coroutines _do_ allocate an AIOCB, so calling bdrv_aio_readv >> > directly can help), but hey it cannot hurt to optimize hot code. > > Not sure if speculations about the fu

Re: [Qemu-devel] [PATCH 5/7] coroutine: rewrite pool to avoid mutex

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 17:40, Kevin Wolf wrote: >> > I still believe we will end with some kind of coroutine bypass scheme >> > (even coroutines _do_ allocate an AIOCB, so calling bdrv_aio_readv >> > directly can help), but hey it cannot hurt to optimize hot code. > > Not sure if speculations about the fu

Re: [Qemu-devel] [PATCH 5/7] coroutine: rewrite pool to avoid mutex

2014-11-28 Thread Kevin Wolf
Am 28.11.2014 um 15:12 hat Paolo Bonzini geschrieben: > I still believe we will end with some kind of coroutine bypass scheme > (even coroutines _do_ allocate an AIOCB, so calling bdrv_aio_readv > directly can help), but hey it cannot hurt to optimize hot code. Not sure if speculations about the f

[Qemu-devel] [PATCH 5/7] coroutine: rewrite pool to avoid mutex

2014-11-28 Thread Paolo Bonzini
This patch removes the mutex by using fancy lock-free manipulation of the pool. Lock-free stacks and queues are not hard, but they can suffer from the ABA problem so they are better avoided unless you have some deferred reclamation scheme like RCU. Otherwise you have to stick with adding to a lis