Skip to content

Conversation

@targos
Copy link
Member

The first commit is just to avoid conflicts with the second one which contains the fix.

Refs: #47297

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/v8-update

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Apr 18, 2023
@targostargos added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 18, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 18, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
MemberAuthor

I'll remove the reverts because the tests are still failing.

@targostargos added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 19, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 19, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targostargos added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 19, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 19, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

targos added 2 commits May 1, 2023 12:42
Original commit message: [wasm] Simplify CompileJSToWasmWrapperJob This CL merges some of AsyncCompileJSToWasmWrapperJob and CompileJSToWasmWrapperJob into a common base class. Both jobs now loop on a vector with an atomic index. Bug: chromium:1423615 Change-Id: I7bb9cb2a57d8b659766c01e20e38d1b859d3a987 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4347597 Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Etienne Pierre-Doray <[email protected]> Cr-Commit-Position: refs/heads/main@{#86675} Refs: v8/v8@a8a11a8
Original commit message: [wasm] Fix deadlock in async wrapper compilation If compilation is cancelled while wrapper compilation is running, the tasks spawned for the{AsyncCompileJSToWasmWrapperJob} will return immediately, but{GetMaxConcurrency} will still return a positive value. Hence{Join()} will spawn another task, resulting in a livelock. We could fix this by checking for cancellation in{GetMaxConcurrency}, but that requires taking the compilation state lock. So this CL fixes the issue by dropping the number of outstanding compilation units by to (basically) zero. We can't unconditionally drop to zero because another thread might concurrently execute a wrapper compilation and still call{CompleteUnit} afterwards. Hence only drop outstanding units by the amount of not-yet-started units. [email protected] Bug: v8:13858 Change-Id: I5398ef370da2e7f212ca772fd1f87f659929dd6d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4437531 Commit-Queue: Clemens Backes <[email protected]> Reviewed-by: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#87143} Refs: v8/v8@5f025d1
@targostargos added the request-ci Add this label to start a Jenkins CI on a PR. label May 1, 2023
@targos
Copy link
MemberAuthor

rebased

@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 1, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
MemberAuthor

Landed in 0736d0b...38d261a

targos added a commit that referenced this pull request May 10, 2023
Original commit message: [wasm] Simplify CompileJSToWasmWrapperJob This CL merges some of AsyncCompileJSToWasmWrapperJob and CompileJSToWasmWrapperJob into a common base class. Both jobs now loop on a vector with an atomic index. Bug: chromium:1423615 Change-Id: I7bb9cb2a57d8b659766c01e20e38d1b859d3a987 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4347597 Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Etienne Pierre-Doray <[email protected]> Cr-Commit-Position: refs/heads/main@{#86675} Refs: v8/v8@a8a11a8 PR-URL: #47610 Refs: #47297 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
targos added a commit that referenced this pull request May 10, 2023
Original commit message: [wasm] Fix deadlock in async wrapper compilation If compilation is cancelled while wrapper compilation is running, the tasks spawned for the{AsyncCompileJSToWasmWrapperJob} will return immediately, but{GetMaxConcurrency} will still return a positive value. Hence{Join()} will spawn another task, resulting in a livelock. We could fix this by checking for cancellation in{GetMaxConcurrency}, but that requires taking the compilation state lock. So this CL fixes the issue by dropping the number of outstanding compilation units by to (basically) zero. We can't unconditionally drop to zero because another thread might concurrently execute a wrapper compilation and still call{CompleteUnit} afterwards. Hence only drop outstanding units by the amount of not-yet-started units. [email protected] Bug: v8:13858 Change-Id: I5398ef370da2e7f212ca772fd1f87f659929dd6d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4437531 Commit-Queue: Clemens Backes <[email protected]> Reviewed-by: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#87143} Refs: v8/v8@5f025d1 PR-URL: #47610 Refs: #47297 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
@targostargos closed this May 10, 2023
@targostargos deleted the v8-deadlock branch May 10, 2023 12:37
targos added a commit that referenced this pull request May 12, 2023
Original commit message: [wasm] Simplify CompileJSToWasmWrapperJob This CL merges some of AsyncCompileJSToWasmWrapperJob and CompileJSToWasmWrapperJob into a common base class. Both jobs now loop on a vector with an atomic index. Bug: chromium:1423615 Change-Id: I7bb9cb2a57d8b659766c01e20e38d1b859d3a987 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4347597 Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Etienne Pierre-Doray <[email protected]> Cr-Commit-Position: refs/heads/main@{#86675} Refs: v8/v8@a8a11a8 PR-URL: #47610 Refs: #47297 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
targos added a commit that referenced this pull request May 12, 2023
Original commit message: [wasm] Fix deadlock in async wrapper compilation If compilation is cancelled while wrapper compilation is running, the tasks spawned for the{AsyncCompileJSToWasmWrapperJob} will return immediately, but{GetMaxConcurrency} will still return a positive value. Hence{Join()} will spawn another task, resulting in a livelock. We could fix this by checking for cancellation in{GetMaxConcurrency}, but that requires taking the compilation state lock. So this CL fixes the issue by dropping the number of outstanding compilation units by to (basically) zero. We can't unconditionally drop to zero because another thread might concurrently execute a wrapper compilation and still call{CompleteUnit} afterwards. Hence only drop outstanding units by the amount of not-yet-started units. [email protected] Bug: v8:13858 Change-Id: I5398ef370da2e7f212ca772fd1f87f659929dd6d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4437531 Commit-Queue: Clemens Backes <[email protected]> Reviewed-by: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#87143} Refs: v8/v8@5f025d1 PR-URL: #47610 Refs: #47297 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]>
@targostargos mentioned this pull request May 15, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buildIssues and PRs related to build files or the CI.needs-ciPRs that need a full CI run.v8 engineIssues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@targos@nodejs-github-bot@jasnell@richardlau