jameysharp opened PR #8397 from jameysharp:minimal-probestack
to bytecodealliance:main
:
When we have
enable_probestack
turned on and setprobestack_strategy
to "inline", we have to compute how many pages of the stack we'll probe.The current implementation rounds our stack frame size up to the nearest multiple of the page size, then probes each page once.
However, if our stack frame is not a multiple of the page size, that means there's a partial page at the end. It's not necessary to probe that partial page, just like it's unnecessary to probe at all if the frame is smaller than one page. Either way, any signal handler needs to be prepared for stack accesses on that last page to fault at any time during the function's execution.
jameysharp requested fitzgen for a review on PR #8397.
jameysharp requested wasmtime-compiler-reviewers for a review on PR #8397.
fitzgen submitted PR review:
Good find!
fitzgen submitted PR review:
Good find!
fitzgen created PR review comment:
Mind leaving a comment about why this doesn't need aligning up here? Kind of unfortunate it would need to be copied to all the other inline probestack code paths. Maybe that is a sign that we should factor this little bit of logic out to a generic helper?
Last updated: Nov 22 2024 at 17:03 UTC