Stream: git-wasmtime

Topic: wasmtime / PR #8397 cranelift: Round inline stack probes ...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2024 at 22:11):

jameysharp opened PR #8397 from jameysharp:minimal-probestack to bytecodealliance:main:

When we have enable_probestack turned on and set probestack_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.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2024 at 22:11):

jameysharp requested fitzgen for a review on PR #8397.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2024 at 22:11):

jameysharp requested wasmtime-compiler-reviewers for a review on PR #8397.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 18 2024 at 17:51):

fitzgen submitted PR review:

Good find!

view this post on Zulip Wasmtime GitHub notifications bot (Apr 18 2024 at 17:51):

fitzgen submitted PR review:

Good find!

view this post on Zulip Wasmtime GitHub notifications bot (Apr 18 2024 at 17:51):

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: Oct 23 2024 at 20:03 UTC