Re: [PATCH v1] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-05-08 Thread Paolo Bonzini
Il 08/05/2014 07:24, Ming Lei ha scritto: Access to tgt-req_vq is strictly serialized by spin_lock of tgt-tgt_lock, so the ACCESS_ONCE() isn't necessary. smp_read_barrier_depends() in virtscsi_req_done was introduced to order reading req_vq and decreasing tgt-reqs, but it isn't needed now

Re: [PATCH v1] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-05-08 Thread Ming Lei
On Thu, May 8, 2014 at 3:05 PM, Paolo Bonzini pbonz...@redhat.com wrote: Decrements of reqs are never concurrent with writes of req_vq: before the decrement reqs will be != 0; after the decrement the virtqueue completion routine will not use the req_vq so it can be changed by a new request.

[PATCH v1] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-05-07 Thread Ming Lei
Access to tgt-req_vq is strictly serialized by spin_lock of tgt-tgt_lock, so the ACCESS_ONCE() isn't necessary. smp_read_barrier_depends() in virtscsi_req_done was introduced to order reading req_vq and decreasing tgt-reqs, but it isn't needed now because req_vq is read from scsi-req_vqs[vq-index