Repository navigation
Conversation
erikrose
force-pushed
the
interrupt-poll-instruction
branch
from
October 6, 2026 20:15
c9c67c6 to
0b0e8f5
Compare
It facilitates the cooperative interruption of Cranelift-compiled code, triggered by a background thread's twiddling of MMU protection bits on a polled page of memory. This is the first step toward implementing MMU-triggered interruption of Wasm (bytecodealliance#1749). Saúl did the aarch64 implementation. Co-authored-by: Saúl Cabrera <saulecabrera@gmail.com>
erikrose
force-pushed
the
interrupt-poll-instruction
branch
from
October 6, 2026 23:47
6d6549c to
877e60a
Compare
erikrose
marked this pull request as ready for review
October 7, 2026 00:00
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first step toward implementing MMU-triggered interruption of Wasm (originally suggested in #1749). It's the first little PR broken off the large #12990 for ease of review.
This PR introduces a Cranelift instruction that facilitates resumeable preemptions: in this case, with MMU-based Wasm interruption in mind. However, the same technique is used by HotSpot for stop-the-world GC, so there is potential for other applications.
The original name for this instruction was
dead_load_with_context. At the time, that was sufficiently descriptive. However, since then, we've added…Thus, it's become specialized enough to the task of implementing virtual-memory-triggered interruption mechanisms that it makes sense to rename it with that in mind. Other names I considered include "preempt_poll" (but it ultimately functions cooperatively, so nah), "yield_poll" (too tightly coupled to the one use case I'm chasing right now), and "probe" instead of "poll". HotSpot uses "poll" for their mechanism, so that'll be familiar to some, and it usefully suggests that it will have to be done repeatedly in the usual case.
I recommend reviewing this commit-by-commit.