Re: [PATCH v2 1/9] KVM: add kvm_request_pending

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

 




On 06/04/2017 23:08, Andrew Jones wrote:
> My own made-up lingo to state that each time the variable is accessed it
> must be loaded anew, taken care of by the volatile use in READ_ONCE.  As
> vcpu->requests can be written by other threads, then I prefer READ_ONCE
> being used to read it, as it allows me to avoid spending energy convincing
> myself that the compiler would have emitted a load at that point anyway.

Also, READ_ONCE without a barrier is really fishy unless it's

  while (READ_ONCE(x) != 2) {
      ...
  }

or similar, and WRITE_ONCE doesn't even have this exception.  So
annotating variables accessed by multiple threads with
READ_ONCE/WRITE_ONCE is generally a good idea.

Paolo



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux