Skip to content

lkl: irq: atomically drain pending IRQs#640

Merged
tavip merged 1 commit into
lkl:masterfrom
clingfei:master
Jun 14, 2026
Merged

lkl: irq: atomically drain pending IRQs#640
tavip merged 1 commit into
lkl:masterfrom
clingfei:master

Conversation

@clingfei

Copy link
Copy Markdown

Pending IRQs can be published from host threads while the LKL CPU is owned elsewhere or while interrupts are disabled. Avoid checking the IRQ pending bitmaps with plain loads before the atomic fetch-and-clear, as that can race with concurrent updates and skip newly published work.

Also keep draining the index bitmap until it becomes empty, so IRQs queued while earlier pending IRQs are being handled are delivered in the same pass instead of waiting for a later run_irqs() invocation.

Pending IRQs can be published from host threads while the LKL CPU is
owned elsewhere or while interrupts are disabled. Avoid checking the IRQ
pending bitmaps with plain loads before the atomic fetch-and-clear, as
that can race with concurrent updates and skip newly published work.

Also keep draining the index bitmap until it becomes empty, so IRQs
queued while earlier pending IRQs are being handled are delivered in the
same pass instead of waiting for a later run_irqs() invocation.

Signed-off-by: clingfei <chenglingfei@foxmail.com>
@github-actions

Copy link
Copy Markdown

Test Results

106 files  ±0  106 suites  ±0   8m 51s ⏱️ + 2m 35s
205 tests ±0  194 ✅ ±0  11 💤 ±0  0 ❌ ±0 
789 runs  ±0  733 ✅ ±0  56 💤 ±0  0 ❌ ±0 

Results for commit 17a1086. ± Comparison against base commit 91ecb83.

@tavip tavip left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find, thank you @clingfei !

@tavip tavip merged commit e50792e into lkl:master Jun 14, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants