[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/4] exec: Atomic access to bounce buffer
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/4] exec: Atomic access to bounce buffer |
Date: |
Fri, 13 Mar 2015 16:38:49 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, 03/13 09:32, Paolo Bonzini wrote:
>
>
> On 13/03/2015 09:16, Fam Zheng wrote:
> >>> > > + if (atomic_cmpxchg(&bounce.in_use, false, true)) {
> >> >
> >> > atomic_or is enough...
> > atomic_cmpxchg is here to take the ownership of bounce iff it is not in
> > use, so
> > I think it is necessary.
>
> It's changing false to true and true to true, so you can do
>
> if (atomic_or(&bounce.in_use, 1)) {
> // was true already
> }
I see, we have the old value! Thanks!
Fam
[Qemu-devel] [PATCH v2 1/4] exec: Atomic access to bounce buffer, Fam Zheng, 2015/03/12
[Qemu-devel] [PATCH v2 2/4] exec: Atomic access to map_client_list, Fam Zheng, 2015/03/12
[Qemu-devel] [PATCH v2 3/4] exec: Notify cpu_register_map_client caller if the bounce buffer is available, Fam Zheng, 2015/03/12