git: virtio: Replace one cpu_mfence() by cpu_lfence(), and one by cpu_sfence().

Imre Vadasz ivadasz at crater.dragonflybsd.org
Sun Apr 2 01:03:42 PDT 2017


commit dfa408369ca6b7b1718558ba44e558dfc9053414
Author: Imre Vadász <imre at vdsz.com>
Date:   Mon Feb 13 20:16:14 2017 +0100

    virtio: Replace one cpu_mfence() by cpu_lfence(), and one by cpu_sfence().
    
    * The cpu_mfence() in virtqueue_dequeue() can be replaced by cpu_lfence(),
      since we only need to make sure that we read the vq->vq_ring.used->idx
      value before reading any other entries from the vq->vq_ring.used ring.
    
    * The cpu_mfence() in vq_ring_update_avail() can be replaced by
      cpu_sfence(), since no one else is writing to the vq->vq_ring.avail
      struct.

Summary of changes:
 sys/dev/virtual/virtio/virtio/virtqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/dfa408369ca6b7b1718558ba44e558dfc9053414


-- 
DragonFly BSD source repository


More information about the Commits mailing list