Skip to contentSkip to conversation

vhost-vsock: remove unused vq variable

PATCH Applied Peng Tao 3 participants 10 messages Dec 7, 2016 – Dec 8, 2016

Subsystems (6)
lore
Share & tools
lore

Peng Tao

author
#0 lore raw

PATCH 1/2 vhost-vsock: remove unused vq variable

---
 drivers/vhost/vsock.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/vhost/vsock.c +0 -3
index 0c23b55..3e01d58 100644
@@ -195,7 +195,6 @@ static int
 vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt)
 {
 	struct vhost_vsock *vsock;
-	struct vhost_virtqueue *vq;
 	int len = pkt->len;
 
 	/* Find the vhost_vsock according to guest context id  */
@@ -205,8 +204,6 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt)
 		return -ENODEV;
 	}
 
-	vq = &vsock->vqs[VSOCK_VQ_RX];
-
 	if (pkt->reply)
 		atomic_inc(&vsock->queued_replies);
 
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 vhost: remove unnecessary smp_mb from vhost_work_queue

test_and_set_bit() already implies a memory barrier.

---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vhost.c +1 -1
index c6f2d89..2663543 100644
@@ -261,8 +261,8 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work)
 	if (!test_and_set_bit(VHOST_WORK_QUEUED, &work->flags)) {
 		/* We can only add the work to the list after we're
 		 * sure it was not in the list.
+		 * test_and_set_bit() implies a memory barrier.
 		 */
-		smp_mb();
 		llist_add(&work->node, &dev->work_list);
 		wake_up_process(dev->worker);
 	}
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 2/2 vhost: remove unnecessary smp_mb from vhost_work_queue

In reply to Peng Tao

test_and_set_bit() already implies a memory barrier.

---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vhost.c +1 -1
index c6f2d89..2663543 100644
@@ -261,8 +261,8 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work)
 	if (!test_and_set_bit(VHOST_WORK_QUEUED, &work->flags)) {
 		/* We can only add the work to the list after we're
 		 * sure it was not in the list.
+		 * test_and_set_bit() implies a memory barrier.
 		 */
-		smp_mb();
 		llist_add(&work->node, &dev->work_list);
 		wake_up_process(dev->worker);
 	}
Signature · 1 line
2.7.4
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] vhost: remove unnecessary smp_mb from vhost_work_queue

In reply to Peng Tao
Quoted 6 lines · Peng Tao

test_and_set_bit() already implies a memory barrier.

---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization