netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peng Tao <bergwolf@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, Peng Tao <bergwolf@gmail.com>
Subject: [PATCH 2/2] vhost: remove unnecessary smp_mb from vhost_work_queue
Date: Wed,  7 Dec 2016 17:52:19 +0800	[thread overview]
Message-ID: <1481104340-77035-2-git-send-email-bergwolf@gmail.com> (raw)
In-Reply-To: <1481104340-77035-1-git-send-email-bergwolf@gmail.com>

test_and_set_bit() already implies a memory barrier.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index c6f2d89..2663543 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -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);
 	}
-- 
2.7.4

  reply	other threads:[~2016-12-07  9:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07  9:52 [PATCH 1/2] vhost-vsock: remove unused vq variable Peng Tao
2016-12-07  9:52 ` Peng Tao [this message]
2016-12-07 13:10   ` [PATCH 2/2] vhost: remove unnecessary smp_mb from vhost_work_queue Stefan Hajnoczi
2016-12-08 16:30   ` David Miller
2016-12-07 13:10 ` [PATCH 1/2] vhost-vsock: remove unused vq variable Stefan Hajnoczi
2016-12-08 16:30 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1481104340-77035-2-git-send-email-bergwolf@gmail.com \
    --to=bergwolf@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).