summaryrefslogtreecommitdiff
path: root/drivers/vhost/net.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-07-01 18:40:12 +0300
committerMichael S. Tsirkin <mst@redhat.com>2010-07-01 19:25:40 +0300
commit7b3384fc30633738ae4eaf8e1bc6ce70470ced80 (patch)
treefdf56de2245e095f7e451f025cb55f7cb8a704b5 /drivers/vhost/net.c
parentd5675bd204efd87a174eeea592de23c4c4e7f908 (diff)
downloadlinux-stable-7b3384fc30633738ae4eaf8e1bc6ce70470ced80.tar.gz
linux-stable-7b3384fc30633738ae4eaf8e1bc6ce70470ced80.tar.bz2
linux-stable-7b3384fc30633738ae4eaf8e1bc6ce70470ced80.zip
vhost: add unlikely annotations to error path
patch 'break out of polling loop on error' caused a minor performance regression on my machine: recover that performance by adding a bunch of unlikely annotations in the error handling. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r--drivers/vhost/net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 54096eef4840..2406377a6e5e 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -137,7 +137,7 @@ static void handle_tx(struct vhost_net *net)
&out, &in,
NULL, NULL);
/* On error, stop handling until the next kick. */
- if (head < 0)
+ if (unlikely(head < 0))
break;
/* Nothing new? Wait for eventfd to tell us they refilled. */
if (head == vq->num) {
@@ -234,7 +234,7 @@ static void handle_rx(struct vhost_net *net)
&out, &in,
vq_log, &log);
/* On error, stop handling until the next kick. */
- if (head < 0)
+ if (unlikely(head < 0))
break;
/* OK, now we need to know about added descriptors. */
if (head == vq->num) {