From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Ying Fang <fangying1@huawei.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 4/4] async: use explicit memory barriers and relaxed accesses
Date: Tue, 7 Apr 2020 11:18:29 +0200 [thread overview]
Message-ID: <f157bf5b-10e0-7cee-795b-330e1d390cd2@redhat.com> (raw)
In-Reply-To: <20200407090954.GC247777@stefanha-x1.localdomain>
[-- Attachment #1.1: Type: text/plain, Size: 518 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-04-07 9:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 19:13 [RFC PATCH 0/4] async: fix hangs on weakly-ordered architectures Paolo Bonzini
2020-04-06 19:13 ` [PATCH 1/4] atomics: convert to reStructuredText Paolo Bonzini
2020-04-06 19:58 ` Eric Blake
2020-04-07 10:29 ` Paolo Bonzini
2020-04-06 19:13 ` [PATCH 2/4] atomics: update documentation for C11 Paolo Bonzini
2020-04-06 20:03 ` Eric Blake
2020-04-07 9:06 ` Stefan Hajnoczi
2020-04-07 9:13 ` Paolo Bonzini
2020-04-06 19:13 ` [PATCH 3/4] rcu: do not mention atomic_mb_read/set in documentation Paolo Bonzini
2020-04-06 19:13 ` [PATCH 4/4] async: use explicit memory barriers and relaxed accesses Paolo Bonzini
2020-04-07 9:09 ` Stefan Hajnoczi
2020-04-07 9:18 ` Paolo Bonzini [this message]
2020-04-07 9:10 ` [RFC PATCH 0/4] async: fix hangs on weakly-ordered architectures Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f157bf5b-10e0-7cee-795b-330e1d390cd2@redhat.com \
--to=pbonzini@redhat.com \
--cc=fangying1@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).