diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-10-06 09:34:45 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-11-04 07:22:11 -0400 |
commit | 64e1c80748afca3b4818ebb232a9668bf529886d (patch) | |
tree | 80f0be16eaed7b4561c54e3f4a26138848b816f4 /drivers/vhost/net.c | |
parent | 533a19b4b88fcf81da3106b94f0ac4ac8b33a248 (diff) |
vhost-net: batch use/unuse mm
Move use/unuse mm to vhost.c which makes it possible to batch these
operations.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r-- | drivers/vhost/net.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 4b4da5b86ff9..d10da280fa0f 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <linux/eventfd.h> | 10 | #include <linux/eventfd.h> |
11 | #include <linux/vhost.h> | 11 | #include <linux/vhost.h> |
12 | #include <linux/virtio_net.h> | 12 | #include <linux/virtio_net.h> |
13 | #include <linux/mmu_context.h> | ||
14 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
15 | #include <linux/module.h> | 14 | #include <linux/module.h> |
16 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
@@ -142,7 +141,6 @@ static void handle_tx(struct vhost_net *net) | |||
142 | return; | 141 | return; |
143 | } | 142 | } |
144 | 143 | ||
145 | use_mm(net->dev.mm); | ||
146 | mutex_lock(&vq->mutex); | 144 | mutex_lock(&vq->mutex); |
147 | vhost_disable_notify(vq); | 145 | vhost_disable_notify(vq); |
148 | 146 | ||
@@ -207,7 +205,6 @@ static void handle_tx(struct vhost_net *net) | |||
207 | } | 205 | } |
208 | 206 | ||
209 | mutex_unlock(&vq->mutex); | 207 | mutex_unlock(&vq->mutex); |
210 | unuse_mm(net->dev.mm); | ||
211 | } | 208 | } |
212 | 209 | ||
213 | static int peek_head_len(struct sock *sk) | 210 | static int peek_head_len(struct sock *sk) |
@@ -312,7 +309,6 @@ static void handle_rx_big(struct vhost_net *net) | |||
312 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) | 309 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) |
313 | return; | 310 | return; |
314 | 311 | ||
315 | use_mm(net->dev.mm); | ||
316 | mutex_lock(&vq->mutex); | 312 | mutex_lock(&vq->mutex); |
317 | vhost_disable_notify(vq); | 313 | vhost_disable_notify(vq); |
318 | hdr_size = vq->vhost_hlen; | 314 | hdr_size = vq->vhost_hlen; |
@@ -391,7 +387,6 @@ static void handle_rx_big(struct vhost_net *net) | |||
391 | } | 387 | } |
392 | 388 | ||
393 | mutex_unlock(&vq->mutex); | 389 | mutex_unlock(&vq->mutex); |
394 | unuse_mm(net->dev.mm); | ||
395 | } | 390 | } |
396 | 391 | ||
397 | /* Expects to be always run from workqueue - which acts as | 392 | /* Expects to be always run from workqueue - which acts as |
@@ -423,7 +418,6 @@ static void handle_rx_mergeable(struct vhost_net *net) | |||
423 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) | 418 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) |
424 | return; | 419 | return; |
425 | 420 | ||
426 | use_mm(net->dev.mm); | ||
427 | mutex_lock(&vq->mutex); | 421 | mutex_lock(&vq->mutex); |
428 | vhost_disable_notify(vq); | 422 | vhost_disable_notify(vq); |
429 | vhost_hlen = vq->vhost_hlen; | 423 | vhost_hlen = vq->vhost_hlen; |
@@ -500,7 +494,6 @@ static void handle_rx_mergeable(struct vhost_net *net) | |||
500 | } | 494 | } |
501 | 495 | ||
502 | mutex_unlock(&vq->mutex); | 496 | mutex_unlock(&vq->mutex); |
503 | unuse_mm(net->dev.mm); | ||
504 | } | 497 | } |
505 | 498 | ||
506 | static void handle_rx(struct vhost_net *net) | 499 | static void handle_rx(struct vhost_net *net) |