Re: [Qemu-devel] [PATCH 1/2] exec: Convert bounce buffer to a set

2015-03-10 Thread Fam Zheng
On Tue, 03/10 12:14, Paolo Bonzini wrote: > > > On 10/03/2015 08:50, Fam Zheng wrote: > > +QLIST_ENTRY(BounceBuffer) next; > > Where is this used? Unused, I will remove this. > > > -if (buffer != bounce.buffer) { > > +BounceBuffer *bounce; > > + > > +bounce = bounce_buffer_fin

Re: [Qemu-devel] [PATCH 1/2] exec: Convert bounce buffer to a set

2015-03-10 Thread Paolo Bonzini
On 10/03/2015 08:50, Fam Zheng wrote: > +QLIST_ENTRY(BounceBuffer) next; Where is this used? > -if (buffer != bounce.buffer) { > +BounceBuffer *bounce; > + > +bounce = bounce_buffer_find_and_remove(buffer); > +if (!bounce) { I'm afraid that this adds a mutex lock/unlock pai

[Qemu-devel] [PATCH 1/2] exec: Convert bounce buffer to a set

2015-03-10 Thread Fam Zheng
With the introduction of dataplane, the global bounce buffer is neither thread-safe nor multi-thread friendly. The problems are: 1) Access to "bounce" is not atomic, thus not safe from dataplane thread. 2) Access to "map_client_list" is not atomic, thus not safe from dataplane thread. 3) In