[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] os: don't corrupt pre-existing memory-backend d
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] os: don't corrupt pre-existing memory-backend data with prealloc |
Date: |
Fri, 24 Feb 2017 13:18:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 24/02/2017 13:12, Dr. David Alan Gilbert wrote:
>> Ok, yeah, it makes sense that the compiler can optimize that away without
>> volatile. I wonder if adding volatile has much of a performance impact on
>> this loop...
> I don't think we have anything else in QEMU to do it (other than atomic's
> but we don't need this to be atomic). I don't think the use of memset()
> helps, because the compiler is free to optimise that out as well; so
> I think 'volatile' is a reasonable use (although I seem to have a soft-spot
> for volatile and I know everyone else tells me I'm mad).
Yes, I think it is fine to use volatile here.
Paolo
Re: [Qemu-devel] [PATCH] os: don't corrupt pre-existing memory-backend data with prealloc, Stefan Hajnoczi, 2017/02/27