qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] util/interval-tree: Avoid race conditions without optimizati


From: Richard Henderson
Subject: Re: [PATCH] util/interval-tree: Avoid race conditions without optimization
Date: Thu, 13 Jul 2023 16:42:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]