aboutsummaryrefslogtreecommitdiff
path: root/drivers/lguest/core.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-06-12 22:27:02 -0600
committerRusty Russell <rusty@rustcorp.com.au>2009-06-12 22:27:03 +0930
commita32a8813d0173163ba44d8f9556e0d89fdc4fb46 (patch)
treefddb6742338047d0219e8c2536cd39b04e643b16 /drivers/lguest/core.c
parentabd41f037e1a64543000ed73b42f616d04d92700 (diff)
lguest: improve interrupt handling, speed up stream networking
lguest never checked for pending interrupts when enabling interrupts, and things still worked. However, it makes a significant difference to TCP performance, so it's time we fixed it by introducing a pending_irq flag and checking it on irq_restore and irq_enable. These two routines are now too big to patch into the 8/10 bytes patch space, so we drop that code. Note: The high latency on interrupt delivery had a very curious effect: once everything else was optimized, networking without GSO was faster than networking with GSO, since more interrupts were sent and hence a greater chance of one getting through to the Guest! Note2: (Almost) Closing the same loophole for iret doesn't have any measurable effect, so I'm leaving that patch for the moment. Before: 1GB tcpblast Guest->Host: 30.7 seconds 1GB tcpblast Guest->Host (no GSO): 76.0 seconds After: 1GB tcpblast Guest->Host: 6.8 seconds 1GB tcpblast Guest->Host (no GSO): 27.8 seconds Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/core.c')
-rw-r--r--drivers/lguest/core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index 8ca1def5b14..03fbc88c002 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -189,6 +189,7 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
/* We stop running once the Guest is dead. */
while (!cpu->lg->dead) {
unsigned int irq;
+ bool more;
/* First we run any hypercalls the Guest wants done. */
if (cpu->hcall)
@@ -213,9 +214,9 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
/* Check if there are any interrupts which can be delivered now:
* if so, this sets up the hander to be executed when we next
* run the Guest. */
- irq = interrupt_pending(cpu);
+ irq = interrupt_pending(cpu, &more);
if (irq < LGUEST_IRQS)
- try_deliver_interrupt(cpu, irq);
+ try_deliver_interrupt(cpu, irq, more);
/* All long-lived kernel loops need to check with this horrible
* thing called the freezer. If the Host is trying to suspend,
@@ -233,7 +234,7 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
set_current_state(TASK_INTERRUPTIBLE);
/* Just before we sleep, make sure nothing snuck in
* which we should be doing. */
- if (interrupt_pending(cpu) < LGUEST_IRQS
+ if (interrupt_pending(cpu, &more) < LGUEST_IRQS
|| cpu->break_out)
set_current_state(TASK_RUNNING);
else