[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/4] async: use explicit memory barriers and relaxed accesses
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 4/4] async: use explicit memory barriers and relaxed accesses |
Date: |
Tue, 7 Apr 2020 11:18:29 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 07/04/20 11:09, Stefan Hajnoczi wrote:
>> if (blocking) {
>> - atomic_add(&ctx->notify_me, 2);
>> + atomic_set(&ctx->notify_me, atomic_read(&ctx->notify_me) + 2);
> Non-atomic "atomic" code looks suspicious and warrants a comment
> mentioning that this is only executed from one thread. This applies to
> the other instances in this patch too.
Yes, that's the patch that is missing from this series, which
strengthens the assertion to ensure that we're in the home thread.
Paolo
signature.asc
Description: OpenPGP digital signature
- [RFC PATCH 0/4] async: fix hangs on weakly-ordered architectures, Paolo Bonzini, 2020/04/06
- [PATCH 3/4] rcu: do not mention atomic_mb_read/set in documentation, Paolo Bonzini, 2020/04/06
- [PATCH 4/4] async: use explicit memory barriers and relaxed accesses, Paolo Bonzini, 2020/04/06
- [PATCH 2/4] atomics: update documentation for C11, Paolo Bonzini, 2020/04/06
- [PATCH 1/4] atomics: convert to reStructuredText, Paolo Bonzini, 2020/04/06
- Re: [RFC PATCH 0/4] async: fix hangs on weakly-ordered architectures, Stefan Hajnoczi, 2020/04/07