Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1369629

RE: [PATCH 2/7] Drivers: hv: vmbus: Use READ_ONCE() to read variables that are volatile

From KY Srinivasan <kys@microsoft.com>
Newsgroups linux.kernel
Subject RE: [PATCH 2/7] Drivers: hv: vmbus: Use READ_ONCE() to read variables that are volatile
Date 2016-04-02 00:10 +0200
Message-ID <rjfqq-2i4-9@gated-at.bofh.it> (permalink)
References <rg0ee-2bF-3@gated-at.bofh.it> <rg0ee-2bF-5@gated-at.bofh.it> <rg0ee-2bF-7@gated-at.bofh.it> <riUP0-4r5-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Thursday, March 31, 2016 5:01 PM
> To: KY Srinivasan <kys@microsoft.com>
> Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org;
> olaf@aepfle.de; apw@canonical.com; vkuznets@redhat.com;
> jasowang@redhat.com
> Subject: Re: [PATCH 2/7] Drivers: hv: vmbus: Use READ_ONCE() to read
> variables that are volatile
> 
> On Wed, Mar 23, 2016 at 05:53:52PM -0700, K. Y. Srinivasan wrote:
> > Use the READ_ONCE macro to access variabes that can change
> asynchronously.
> 
> Why?  What is this "fixing"?

This is to prevent the compiler optimizations and moving the code. This is the
recommended mechanism for reading volatile variables. 

Regards,

K. Y
> 
> thanks,
> 
> greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 2/7] Drivers: hv: vmbus: Use READ_ONCE() to read variables that are volatile "K. Y. Srinivasan" <kys@microsoft.com> - 2016-03-24 00:20 +0100
  Re: [PATCH 2/7] Drivers: hv: vmbus: Use READ_ONCE() to read  variables that are volatile Greg KH <gregkh@linuxfoundation.org> - 2016-04-01 02:10 +0200
    RE: [PATCH 2/7] Drivers: hv: vmbus: Use READ_ONCE() to read variables  that are volatile KY Srinivasan <kys@microsoft.com> - 2016-04-02 00:10 +0200

csiph-web