x86/xen: resume timer irqs early
Subsystems (2)
PATCH 1/1 x86/xen: resume timer irqs early
If the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).
Add IRQF_EARLY_RESUME to the timer interrupts so they are resumed in syscore_resume().
Also add IRQF_NO_SUSPEND as it is not necessary to suspend the timer interrupts and IRQF_FORCE_RESUME was already set.
--- arch/x86/xen/time.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/x86/xen/time.c +4 -2
@@ -443,8 +443,10 @@ void xen_setup_timer(int cpu) name ="<timer kasprintf failed>" ; irq =bind_virq_to_irqhandler (VIRQ_TIMER , cpu, xen_timer_interrupt, -IRQF_PERCPU |IRQF_NOBALANCING |IRQF_TIMER | -IRQF_FORCE_RESUME , +IRQF_PERCPU |IRQF_NOBALANCING + |IRQF_TIMER + |IRQF_NO_SUSPEND |IRQF_FORCE_RESUME + |IRQF_EARLY_RESUME , name,NULL ); (void )xen_set_irq_priority (irq,XEN_IRQ_PRIORITY_MAX );
Signature · 1 line
1.7.10.4
Boris Ostrovsky
reviewerQuoted 11 lines · David Vrabel
If the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls
schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).
Quoted 5 lines
Add
IRQF_EARLY_RESUMEto the timer interrupts so they are resumed insyscore_resume().Also add
IRQF_NO_SUSPENDas it is not necessary to suspend the timer interrupts andIRQF_FORCE_RESUMEwas already set.
IRQF_NO_SUSPEND is a component of IRQF_TIMER.
-boris
Quoted 23 lines
Signed-off-by David Vrabel <[email protected]>--- arch/x86/xen/time.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)arch/x86/xen/time.c +4
-2@@ -443,8 +443,10 @@ void xen_setup_timer(int cpu) name ="<timer kasprintf failed>" ; irq =bind_virq_to_irqhandler (VIRQ_TIMER , cpu, xen_timer_interrupt, -IRQF_PERCPU |IRQF_NOBALANCING |IRQF_TIMER | -IRQF_FORCE_RESUME , +IRQF_PERCPU |IRQF_NOBALANCING + |IRQF_TIMER + |IRQF_NO_SUSPEND |IRQF_FORCE_RESUME + |IRQF_EARLY_RESUME , name,NULL ); (void )xen_set_irq_priority (irq,XEN_IRQ_PRIORITY_MAX );
Quoted 12 lines · Boris Ostrovsky
Quoted 11 lines · David Vrabel
If the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls
schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).
Quoted 8 lines
Quoted 5 lines
Add
IRQF_EARLY_RESUMEto the timer interrupts so they are resumed insyscore_resume().Also add
IRQF_NO_SUSPENDas it is not necessary to suspend the timer interrupts andIRQF_FORCE_RESUMEwas already set.
IRQF_NO_SUSPENDis a component ofIRQF_TIMER.
So it is. How about this instead?
8<----------------------------
x86/xen: resume timer irqs early
If the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).
Add IRQF_EARLY_RESUME to the timer interrupts so they are resumed in syscore_resume().
--- arch/x86/xen/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/time.c +1 -1
@@ -444,7 +444,7 @@ void xen_setup_timer(int cpu) irq =bind_virq_to_irqhandler (VIRQ_TIMER , cpu, xen_timer_interrupt,IRQF_PERCPU |IRQF_NOBALANCING |IRQF_TIMER | -IRQF_FORCE_RESUME , +IRQF_FORCE_RESUME |IRQF_EARLY_RESUME , name,NULL ); (void )xen_set_irq_priority (irq,XEN_IRQ_PRIORITY_MAX );
Signature · 1 line
1.7.10.4
Quoted 13 lines · David Vrabel
Quoted 12 lines · Boris Ostrovsky
Quoted 11 lines · David Vrabel
If the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls
schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Add
IRQF_EARLY_RESUMEto the timer interrupts so they are resumed insyscore_resume().Also add
IRQF_NO_SUSPENDas it is not necessary to suspend the timer interrupts andIRQF_FORCE_RESUMEwas already set.
IRQF_NO_SUSPENDis a component ofIRQF_TIMER.So it is. How about this instead?
The change makes sense so
but I am curious whether you actually were able to prove that it in fact fixes the hang (the description doesn't make it clear).
-boris
Quoted 36 lines
8<----------------------------
x86/xen: resume timer irqs earlyIf the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls
schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).Add
IRQF_EARLY_RESUMEto the timer interrupts so they are resumed insyscore_resume().Signed-off-by David Vrabel <[email protected]>--- arch/x86/xen/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/xen/time.c +1
-1@@ -444,7 +444,7 @@ void xen_setup_timer(int cpu) irq =bind_virq_to_irqhandler (VIRQ_TIMER , cpu, xen_timer_interrupt,IRQF_PERCPU |IRQF_NOBALANCING |IRQF_TIMER | -IRQF_FORCE_RESUME , +IRQF_FORCE_RESUME |IRQF_EARLY_RESUME , name,NULL ); (void )xen_set_irq_priority (irq,XEN_IRQ_PRIORITY_MAX );
Quoted 21 lines · Boris Ostrovsky
Quoted 20 lines · David Vrabel
Quoted 19 lines · Boris Ostrovsky
Quoted 11 lines · David Vrabel
If the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls
schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).Quoted 5 lines
Add
IRQF_EARLY_RESUMEto the timer interrupts so they are resumed insyscore_resume().Also add
IRQF_NO_SUSPENDas it is not necessary to suspend the timer interrupts andIRQF_FORCE_RESUMEwas already set.
IRQF_NO_SUSPENDis a component ofIRQF_TIMER.
Quoted 8 lines
Quoted 1 line
So it is. How about this instead?
The change makes sense so
Reviewed-by Boris Ostrovsky <[email protected]>but I am curious whether you actually were able to prove that it in fact fixes the hang (the description doesn't make it clear).
Without the patch repeatedly migrating a VM would hang during resume after < 500 iterations. With the patch the VM was migrated > 8000 times without a problem.
David
Quoted 26 lines · David Vrabel
Quoted 25 lines · Boris Ostrovsky
Quoted 13 lines · David Vrabel
Quoted 12 lines · Boris Ostrovsky
Quoted 11 lines · David Vrabel
If the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls
schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Add
IRQF_EARLY_RESUMEto the timer interrupts so they are resumed insyscore_resume().Also add
IRQF_NO_SUSPENDas it is not necessary to suspend the timer interrupts andIRQF_FORCE_RESUMEwas already set.
IRQF_NO_SUSPENDis a component ofIRQF_TIMER.So it is. How about this instead?
The change makes sense so
Quoted 8 lines
Quoted 4 lines
Reviewed-by Boris Ostrovsky <[email protected]>but I am curious whether you actually were able to prove that it in fact fixes the hang (the description doesn't make it clear).
Without the patch repeatedly migrating a VM would hang during resume after < 500 iterations. With the patch the VM was migrated > 8000 times without a problem.
Ah, should said patch have a Reported-by too then?
It would also be neat to have that in the description of the patch I think.
Quoted 3 lines
David
Quoted 29 lines · Konrad Rzeszutek Wilk
Quoted 28 lines · David Vrabel
Quoted 27 lines · Boris Ostrovsky
Quoted 13 lines · David Vrabel
Quoted 12 lines · Boris Ostrovsky
Quoted 11 lines · David Vrabel
If the timer irqs are resumed during device resume it is possible in certain circumstances for the resume to hang early on, before device interrupts are resumed.
It is not entirely clear what is occuring the point of the hang but I think a task necessary for the resume calls
schedule_timeout(), waiting for a timer interrupt (which never arrives). This failure may require specific tasks to be running on the other VCPUs to trigger (processes are not frozen during a suspend/resume if PREEMPT is disabled).Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Add
IRQF_EARLY_RESUMEto the timer interrupts so they are resumed insyscore_resume().Also add
IRQF_NO_SUSPENDas it is not necessary to suspend the timer interrupts andIRQF_FORCE_RESUMEwas already set.
IRQF_NO_SUSPENDis a component ofIRQF_TIMER.So it is. How about this instead?
The change makes sense so
Reviewed-by Boris Ostrovsky <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
but I am curious whether you actually were able to prove that it in fact fixes the hang (the description doesn't make it clear).
Without the patch repeatedly migrating a VM would hang during resume after < 500 iterations. With the patch the VM was migrated > 8000 times without a problem.
Ah, should said patch have a Reported-by too then?
I don't think the XenServer automated test system really minds.
Quoted 1 line
It would also be neat to have that in the description of the patch I think.
I'm not really keen on system-specific numbers like this, but it would probably be useful in this case since my analysis is so woolly.
David