diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-06-05 15:20:27 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-09 16:21:07 +0300 |
commit | 47283bef7ed356629467d1fac61687756e48f254 (patch) | |
tree | 464f8f6973cf9da00fc57679a62638a6c7aee593 /drivers/vhost/test.c | |
parent | ea16c51433510f7f758382dec5b933fc0797f244 (diff) | |
download | linux-47283bef7ed356629467d1fac61687756e48f254.tar.gz linux-47283bef7ed356629467d1fac61687756e48f254.tar.bz2 linux-47283bef7ed356629467d1fac61687756e48f254.zip |
vhost: move memory pointer to VQs
commit 2ae76693b8bcabf370b981cd00c36cd41d33fabc
vhost: replace rcu with mutex
replaced rcu sync for memory accesses with VQ mutex locl/unlock.
This is correct since all accesses are under VQ mutex, but incomplete:
we still do useless rcu lock/unlock operations, someone might copy this
code into some other context where this won't be right.
This use of RCU is also non standard and hard to understand.
Let's copy the pointer to each VQ structure, this way
the access rules become straight-forward, and there's
no need for RCU anymore.
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/test.c')
-rw-r--r-- | drivers/vhost/test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index 6fa3bf8bdec7..d9c501eaa6c3 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -53,7 +53,7 @@ static void handle_vq(struct vhost_test *n) vhost_disable_notify(&n->dev, vq); for (;;) { - head = vhost_get_vq_desc(&n->dev, vq, vq->iov, + head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), &out, &in, NULL, NULL); |