genirq: Prevent migration live lock in handle_edge_irq()
Status from this message: The following commit has been merged into the irq/core branch of tip:
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | genirq: Remove pointless local variablekernel/ | +1 | 0 replies | |
| 2/4 | genirq: Move irq_wait_for_poll() to call sitekernel/ kernel/ kernel/ | +23 | 3 replies | |
| 3/4 | genirq: Split up irq_pm_check_wakeup()kernel/ kernel/ kernel/ | +11 | 0 replies | |
| 4/4 | genirq: Prevent migration live lock in handle_edge_irq()kernel/ | +39 | 1 reply |
Reviews trailers per patch
2 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Liangyan | Jiri Slaby |
|---|---|---|
| Series | T-b | |
| 1/4 | ||
| 2/4 | R-b | |
| 3/4 | ||
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [patch 0/4] genirq: Prevent migration live lock in handle_edge_irq()
Yicon reported and Liangyan debugged a live lock in handle_edge_irq() related to interrupt migration.
If the interrupt affinity is moved to a new target CPU and the interrupt is currently handled on the previous target CPU for edge type interrupts the handler might get stuck on the previous target:
CPU 0 (previous target) CPU 1 (new target)
handle_edge_irq()
repeat:
handle_event() handle_edge_irq()
if (INPROGESS) {
set(PENDING);
mask();
return;
}
if (PENDING) {
clear(PENDING);
unmask();
goto repeat;
}The migration in software never completes and CPU0 continues to handle the pending events forever. This happens when the device raises interrupts with a high rate and always before handle_event() completes and before the CPU0 handler can clear INPROGRESS so that CPU1 sets the PENDING flag over and over. This has been observed in virtual machines.
The following series is addressing this by making the new target CPU wait for the handler to complete on CPU1 and thereby completing the software migration.
A draft combo patch of this has been tested by Liangyan:
https://lore.kernel.org/all/87o6u0rpaa.ffs@tglx
The series splits up the draft patch and has proper changelogs.
Thanks,
tglx
--- chip.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- internals.h | 6 ++--- pm.c | 16 +++++--------- spurious.c | 37 -------------------------------- 4 files changed, 69 insertions(+), 58 deletions(-)