Re: [Qemu-devel] [PATCH v2 2/3] aio: use g_slice_alloc() for AIOCB pooling

2012-11-12 Thread Kevin Wolf
Am 12.11.2012 11:37, schrieb Paolo Bonzini: > Il 12/11/2012 11:34, Kevin Wolf ha scritto: >>> Note that the change from g_malloc0() to g_slice_alloc() should be safe >>> since the freelist reuse case doesn't zero the AIOCB either. >> >> Of course the real reason is that all fields are set anyway. >

Re: [Qemu-devel] [PATCH v2 2/3] aio: use g_slice_alloc() for AIOCB pooling

2012-11-12 Thread Paolo Bonzini
Il 12/11/2012 11:34, Kevin Wolf ha scritto: >> Note that the change from g_malloc0() to g_slice_alloc() should be safe >> since the freelist reuse case doesn't zero the AIOCB either. > > Of course the real reason is that all fields are set anyway. This doesn't necessarily apply for "subclasses",

Re: [Qemu-devel] [PATCH v2 2/3] aio: use g_slice_alloc() for AIOCB pooling

2012-11-12 Thread Kevin Wolf
Am 31.10.2012 16:34, schrieb Stefan Hajnoczi: > AIO control blocks are frequently acquired and released because each aio > request involves at least one AIOCB. Therefore, we pool them to avoid > heap allocation overhead. > > The problem with the freelist approach in AIOPool is thread-safety. If

Re: [Qemu-devel] [PATCH v2 2/3] aio: use g_slice_alloc() for AIOCB pooling

2012-11-02 Thread Paolo Bonzini
Il 31/10/2012 16:34, Stefan Hajnoczi ha scritto: > AIO control blocks are frequently acquired and released because each aio > request involves at least one AIOCB. Therefore, we pool them to avoid > heap allocation overhead. > > The problem with the freelist approach in AIOPool is thread-safety.

[Qemu-devel] [PATCH v2 2/3] aio: use g_slice_alloc() for AIOCB pooling

2012-10-31 Thread Stefan Hajnoczi
AIO control blocks are frequently acquired and released because each aio request involves at least one AIOCB. Therefore, we pool them to avoid heap allocation overhead. The problem with the freelist approach in AIOPool is thread-safety. If we want BlockDriverStates to associate with AioContexts