diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-09-06 14:51:57 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-06 14:51:57 (GMT) |
commit | 7f79d852ed30a06eebf7497afe9334a726db3d40 (patch) | |
tree | 0057281f17501b635d3d88cda9a14203706f5dcc /Documentation/lguest/lguest.c | |
parent | aef745fca016aea45adae5c98e8698904dd8ad51 (diff) | |
parent | 70bb08962ea9bd50797ae9f16b2493f5f7c65053 (diff) | |
download | linux-7f79d852ed30a06eebf7497afe9334a726db3d40.tar.xz |
Merge branch 'linus' into sched/devel
Diffstat (limited to 'Documentation/lguest/lguest.c')
-rw-r--r-- | Documentation/lguest/lguest.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 6554148..7228369 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c @@ -895,6 +895,9 @@ static void handle_console_output(int fd, struct virtqueue *vq, bool timeout) } } +/* This is called when we no longer want to hear about Guest changes to a + * virtqueue. This is more efficient in high-traffic cases, but it means we + * have to set a timer to check if any more changes have occurred. */ static void block_vq(struct virtqueue *vq) { struct itimerval itm; @@ -939,6 +942,11 @@ static void handle_net_output(int fd, struct virtqueue *vq, bool timeout) if (!timeout && num) block_vq(vq); + /* We never quite know how long should we wait before we check the + * queue again for more packets. We start at 500 microseconds, and if + * we get fewer packets than last time, we assume we made the timeout + * too small and increase it by 10 microseconds. Otherwise, we drop it + * by one microsecond every time. It seems to work well enough. */ if (timeout) { if (num < last_timeout_num) timeout_usec += 10; |