afonso360 opened PR #7470 from afonso360:unroll-valgrind
to bytecodealliance:main
:
:wave: Hey,
This PR alters our stackprobe unroll sequences to move the stackpointer before writing to the stack. I don't think there was anything wrong with what we were doing before but it makes valgrind really unhappy. (See #7454)
I've tested this with cg_clif on x86, and it now cleanly passes valgrind for the original reported testcase.
Fixes: #7454
prtest:full
afonso360 requested fitzgen for a review on PR #7470.
afonso360 requested wasmtime-compiler-reviewers for a review on PR #7470.
fitzgen submitted PR review:
Thanks!
fitzgen submitted PR review:
Thanks!
fitzgen created PR review comment:
Out of curiosity / unrelated to this PR: do you know why it is necessary to probe via storing to the stack rather than loading from the stack? It seems like either would accomplish the task AFAICT, and loads should be cheaper than stores.
cfallin submitted PR review.
cfallin created PR review comment:
From the point of view of global cost, stores might actually be better, I suspect: if it faults in a new page, a load would cause a read-only mapping to the global zero page to be created, and the first write would then cause another page fault (at least if the stack is an ordinary
MAP_ANON
region). Or at least, we've seen elsewhere that it's better for first touch to be write when TLB contention is high...
fitzgen submitted PR review.
fitzgen created PR review comment:
Ah okay that makes sense. Thanks!
afonso360 merged PR #7470.
Last updated: Dec 23 2024 at 13:07 UTC