linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/4] genirq: Prevent migration live lock in handle_edge_irq()
@ 2025-07-18 18:54 Thomas Gleixner
  2025-07-18 18:54 ` [patch 1/4] genirq: Remove pointless local variable Thomas Gleixner
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Thomas Gleixner @ 2025-07-18 18:54 UTC (permalink / raw)
  To: LKML; +Cc: Liangyan, Yicong Shen, Jiri Slaby

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(-)



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-07-23  6:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-18 18:54 [patch 0/4] genirq: Prevent migration live lock in handle_edge_irq() Thomas Gleixner
2025-07-18 18:54 ` [patch 1/4] genirq: Remove pointless local variable Thomas Gleixner
2025-07-22 12:45   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2025-07-18 18:54 ` [patch 2/4] genirq: Move irq_wait_for_poll() to call site Thomas Gleixner
2025-07-22  7:07   ` Jiri Slaby
2025-07-22 12:36     ` Thomas Gleixner
2025-07-22 12:45   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2025-07-23  6:22     ` Ingo Molnar
2025-07-18 18:54 ` [patch 3/4] genirq: Split up irq_pm_check_wakeup() Thomas Gleixner
2025-07-22 12:45   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2025-07-18 18:54 ` [patch 4/4] genirq: Prevent migration live lock in handle_edge_irq() Thomas Gleixner
2025-07-22  7:37   ` Jiri Slaby
2025-07-22 12:45   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2025-07-21 15:05 ` [External] [patch 0/4] " Liangyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).