qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [PATCH] util/interval-tree: Avoid race conditions without optimization
Date: Thu, 13 Jul 2023 16:42:51 +0100	[thread overview]
Message-ID: <0c7c6e95-e727-85c9-8fb5-928d9a420de8@linaro.org> (raw)
In-Reply-To: <CAFEAcA9LF_7RKSut0=XrLOnWx9ag7b7R0vWongxBb1dUiHjM0g@mail.gmail.com>

On 7/13/23 12:32, Peter Maydell wrote:
> On Fri, 7 Jul 2023 at 11:30, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> Read the left and right trees once, so that the gating
>> tests are meaningful.  This was only a problem at -O0,
>> where the compiler didn't CSE the two reads.
>>
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> If this data structure is intended to support operations
> being done on it while it's being mutated, shouldn't it
> be using the atomic accessors, though? That would make
> it clearer that you can't just undo the transformation
> made by this patch.

Yes, it probably should.  I use qatomic_set() where the kernel used WRITE_ONCE, but there 
was no markup for the read side.


r~



      reply	other threads:[~2023-07-13 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-07 10:30 [PATCH] util/interval-tree: Avoid race conditions without optimization Richard Henderson
2023-07-13 11:32 ` Peter Maydell
2023-07-13 15:42   ` Richard Henderson [this message]

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=0c7c6e95-e727-85c9-8fb5-928d9a420de8@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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).