vhost: remove unnecessary smp_mb from vhost_work_queue
authorPeng Tao <bergwolf@gmail.com>
Wed, 7 Dec 2016 09:52:19 +0000 (17:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Dec 2016 16:26:46 +0000 (11:26 -0500)
test_and_set_bit() already implies a memory barrier.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/vhost.c

index c6f2d89c0e97cd4c184e615be6e3d86aca722a0d..266354390c8fae0490ef9ee24919e3ec72f1cb2a 100644 (file)
@@ -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);
        }