diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-07-01 11:40:12 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-07-01 12:25:40 -0400 |
commit | 7b3384fc30633738ae4eaf8e1bc6ce70470ced80 (patch) | |
tree | fdf56de2245e095f7e451f025cb55f7cb8a704b5 /drivers/vhost/net.c | |
parent | d5675bd204efd87a174eeea592de23c4c4e7f908 (diff) |
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.c | 4 |
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) | |||
137 | &out, &in, | 137 | &out, &in, |
138 | NULL, NULL); | 138 | NULL, NULL); |
139 | /* On error, stop handling until the next kick. */ | 139 | /* On error, stop handling until the next kick. */ |
140 | if (head < 0) | 140 | if (unlikely(head < 0)) |
141 | break; | 141 | break; |
142 | /* Nothing new? Wait for eventfd to tell us they refilled. */ | 142 | /* Nothing new? Wait for eventfd to tell us they refilled. */ |
143 | if (head == vq->num) { | 143 | if (head == vq->num) { |
@@ -234,7 +234,7 @@ static void handle_rx(struct vhost_net *net) | |||
234 | &out, &in, | 234 | &out, &in, |
235 | vq_log, &log); | 235 | vq_log, &log); |
236 | /* On error, stop handling until the next kick. */ | 236 | /* On error, stop handling until the next kick. */ |
237 | if (head < 0) | 237 | if (unlikely(head < 0)) |
238 | break; | 238 | break; |
239 | /* OK, now we need to know about added descriptors. */ | 239 | /* OK, now we need to know about added descriptors. */ |
240 | if (head == vq->num) { | 240 | if (head == vq->num) { |