New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: Node implementation of v8::Platform #14001

Closed
wants to merge 8 commits into
base: master
from

Conversation

@matthewloring
Contributor

matthewloring commented Jun 30, 2017

Node.js currently uses the V8 implementation of the DefaultPlatform
which schedules VM tasks on a V8 managed thread pool. Since the Node.js
event loop is not aware of these tasks, the Node.js process may exit
while there are outstanding VM tasks. This will become problematic once
asynchronous wasm compilation lands in V8.

This PR introduces a Node.js specific implementation of the v8::Platform
on top of libuv so that the event loop is aware of outstanding VM tasks.

Fixes: #12980

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

src, tracing

@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Jun 30, 2017

Contributor

/cc @jeisinger @nodejs/v8

Contributor

matthewloring commented Jun 30, 2017

/cc @jeisinger @nodejs/v8

@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Jun 30, 2017

Contributor

v8/v8@3d8e87a was reverted upstream in V8 due to tsan failures in multi-isolate scenarios. It should be safe for use by Node.js but we can also swap out that commit once it re-lands in V8 before landing this PR.

(edit by @addaleax: turned the git commit ref into a v8/v8@… ref)

Contributor

matthewloring commented Jun 30, 2017

v8/v8@3d8e87a was reverted upstream in V8 due to tsan failures in multi-isolate scenarios. It should be safe for use by Node.js but we can also swap out that commit once it re-lands in V8 before landing this PR.

(edit by @addaleax: turned the git commit ref into a v8/v8@… ref)

@addaleax

Commented with a few style nits but I think that’s it.

CI: https://ci.nodejs.org/job/node-test-commit/10841/

Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated deps/v8/include/libplatform/libplatform.h Outdated
Show outdated Hide outdated src/node.cc Outdated
Show outdated Hide outdated src/node.cc Outdated
Show outdated Hide outdated src/node.cc Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.h Outdated
Show outdated Hide outdated src/node_platform.h Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.h Outdated
@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Jun 30, 2017

Contributor

Thanks for the comments! I'm currently looking into some intermittent crashes in GC brought on by this change. I'll address these comments once I figure that out.

Contributor

matthewloring commented Jun 30, 2017

Thanks for the comments! I'm currently looking into some intermittent crashes in GC brought on by this change. I'll address these comments once I figure that out.

Show outdated Hide outdated src/node_platform.h Outdated
Show outdated Hide outdated src/node_platform.h Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node.cc Outdated
Show outdated Hide outdated src/node.cc Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.cc Outdated
Show outdated Hide outdated src/node_platform.h Outdated
Show outdated Hide outdated src/tracing/trace_event.cc Outdated
@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring
Contributor

matthewloring commented Jul 21, 2017

@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Jul 21, 2017

Contributor

The CI looks mostly green. The repl timeout seems unrelated. The test-timers-unrefed-in-beforeexit failure is real. If V8 queues up background work during the execution of the beforeExit function, the event loop stays open waiting for that work to complete and then reruns the beforeExit callback again. This can cause the process to hang for sufficiently complicated beforeExit callbacks (I can reproduce this by allocating lots of buffers in beforeExit).

One option would be to drop all V8 background tasks queued during the execution of beforeExit. However, this could be problematic if the user expects to recover and continue execution. @jeisinger Is it possible for background tasks to be dropped or will this leave V8 in an inconsistent state?

Contributor

matthewloring commented Jul 21, 2017

The CI looks mostly green. The repl timeout seems unrelated. The test-timers-unrefed-in-beforeexit failure is real. If V8 queues up background work during the execution of the beforeExit function, the event loop stays open waiting for that work to complete and then reruns the beforeExit callback again. This can cause the process to hang for sufficiently complicated beforeExit callbacks (I can reproduce this by allocating lots of buffers in beforeExit).

One option would be to drop all V8 background tasks queued during the execution of beforeExit. However, this could be problematic if the user expects to recover and continue execution. @jeisinger Is it possible for background tasks to be dropped or will this leave V8 in an inconsistent state?

@jeisinger

This comment has been minimized.

Show comment
Hide comment
@jeisinger

jeisinger Jul 24, 2017

Contributor

some background tasks from the GC will count down semaphores while the main thread waits for the semaphore, so not running background tasks will result in a deadlock on the main thread.

Contributor

jeisinger commented Jul 24, 2017

some background tasks from the GC will count down semaphores while the main thread waits for the semaphore, so not running background tasks will result in a deadlock on the main thread.

@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Jul 25, 2017

Contributor

If background tasks are allowed to be queue during the beforeExit callback, the process could repeatedly invoke beforeExit forever. If background tasks are buffered during the execution of beforeExit and flushed afterwards, the process could deadlock. I experimented with starting another thread at the beginning of beforeExit that could flush background tasks on a timer to make progress if a deadlock occurs. However this is sub-optimal as the process would still hang until the timer fires or beforeExit could still be executing when the timer fires. @jeisinger Would it be possible for the platform API to expose a task priority or some other indicator of whether a task should hold the process open? Longer term would it be possible to move away from blocking the main thread on background task completion?

Contributor

matthewloring commented Jul 25, 2017

If background tasks are allowed to be queue during the beforeExit callback, the process could repeatedly invoke beforeExit forever. If background tasks are buffered during the execution of beforeExit and flushed afterwards, the process could deadlock. I experimented with starting another thread at the beginning of beforeExit that could flush background tasks on a timer to make progress if a deadlock occurs. However this is sub-optimal as the process would still hang until the timer fires or beforeExit could still be executing when the timer fires. @jeisinger Would it be possible for the platform API to expose a task priority or some other indicator of whether a task should hold the process open? Longer term would it be possible to move away from blocking the main thread on background task completion?

@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Aug 1, 2017

Contributor

Flushing all background tasks after beforeExit executes has appeased tests locally. New CI: https://ci.nodejs.org/job/node-test-pull-request/9442/.

Contributor

matthewloring commented Aug 1, 2017

Flushing all background tasks after beforeExit executes has appeased tests locally. New CI: https://ci.nodejs.org/job/node-test-pull-request/9442/.

@addaleax

Just reaffirming that this still LGTM

@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Aug 4, 2017

Contributor

For an update on this, I worked with the V8 team to stop the main thread from blocking on background task completion (reflected in the most recent 3 backports on the PR). A more desirable fix would be to let background tasks started inside beforeExit run and then block until all have completed before determining whether the event loop still has active handles/requests and the process should stay up. However, since background tasks are run using uv_queue_work, there will be active requests in the event loop even after blocking until all background tasks have completed the background portion of their work. The event loop must be run at least once to clear these requests (so that they won't be observed when uv_loop_alive is checked) but there seem to be a fair number of unit tests that depended on no io polling before the uv_loop_alive check. If there was a way to cancel these background tasks after their background work was completed to avoid having their after callbacks added to the event loop or a way to unref reqs as can be done with handles that would solve the problem. @bnoordhuis do you have any thoughts on a work around for this problem?

The current solution will only be problematic if V8 background tasks started inside beforeExit queue foreground tasks as those new foreground tasks will not keep the process up (as will be the case for WASM asynchronous compilation). However, no current V8 background tasks have that behavior to my knowledge so this should be safe for now.

I've started a fresh CI here: https://ci.nodejs.org/job/node-test-pull-request/9486/

Contributor

matthewloring commented Aug 4, 2017

For an update on this, I worked with the V8 team to stop the main thread from blocking on background task completion (reflected in the most recent 3 backports on the PR). A more desirable fix would be to let background tasks started inside beforeExit run and then block until all have completed before determining whether the event loop still has active handles/requests and the process should stay up. However, since background tasks are run using uv_queue_work, there will be active requests in the event loop even after blocking until all background tasks have completed the background portion of their work. The event loop must be run at least once to clear these requests (so that they won't be observed when uv_loop_alive is checked) but there seem to be a fair number of unit tests that depended on no io polling before the uv_loop_alive check. If there was a way to cancel these background tasks after their background work was completed to avoid having their after callbacks added to the event loop or a way to unref reqs as can be done with handles that would solve the problem. @bnoordhuis do you have any thoughts on a work around for this problem?

The current solution will only be problematic if V8 background tasks started inside beforeExit queue foreground tasks as those new foreground tasks will not keep the process up (as will be the case for WASM asynchronous compilation). However, no current V8 background tasks have that behavior to my knowledge so this should be safe for now.

I've started a fresh CI here: https://ci.nodejs.org/job/node-test-pull-request/9486/

@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Aug 4, 2017

Contributor

It looks like there is one remaining related failure which is on windows: https://ci.nodejs.org/job/node-test-binary-windows/10290/RUN_SUBSET=1,VS_VERSION=vs2017,label=win2016/tapResults/. I can try to get my hands on a windows machine but if anyone on @nodejs/platform-windows can reproduce this or has thoughts on why libuv is unhappy I'd appreciate the help.

Contributor

matthewloring commented Aug 4, 2017

It looks like there is one remaining related failure which is on windows: https://ci.nodejs.org/job/node-test-binary-windows/10290/RUN_SUBSET=1,VS_VERSION=vs2017,label=win2016/tapResults/. I can try to get my hands on a windows machine but if anyone on @nodejs/platform-windows can reproduce this or has thoughts on why libuv is unhappy I'd appreciate the help.

@matthewloring

This comment has been minimized.

Show comment
Hide comment
@matthewloring

matthewloring Aug 6, 2017

Contributor

After a few more fixes, it looks like inspector/test-off-with-session-then-on is failing on windows intermittently. @eugeneo Do you have any thoughts on these failures? (example CI: https://ci.nodejs.org/job/node-test-commit/11587/).

Contributor

matthewloring commented Aug 6, 2017

After a few more fixes, it looks like inspector/test-off-with-session-then-on is failing on windows intermittently. @eugeneo Do you have any thoughts on these failures? (example CI: https://ci.nodejs.org/job/node-test-commit/11587/).

@tniessen

src/* LGTM

addaleax added a commit to addaleax/node that referenced this pull request Sep 13, 2017

deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

addaleax added a commit to addaleax/node that referenced this pull request Sep 13, 2017

deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 13, 2017

deps: backport 6e9e2e5 from upstream V8
Original commit message:

  [heap] Move SweeperTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6655
  Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
  Reviewed-on: https://chromium-review.googlesource.com/595467
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47036}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 13, 2017

deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 13, 2017

deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 14, 2017

deps: backport 6e9e2e5 from upstream V8
Original commit message:

  [heap] Move SweeperTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6655
  Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
  Reviewed-on: https://chromium-review.googlesource.com/595467
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47036}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 14, 2017

deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 14, 2017

deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
if (uv_run(env.event_loop(), UV_RUN_NOWAIT) != 0)
more = true;
}
uv_run(env.event_loop(), UV_RUN_DEFAULT);

This comment has been minimized.

@Fishrock123

Fishrock123 Sep 15, 2017

Member

Is everyone here sure this doesn't break something edge-casey with beforeExit and order of operations?

I'm trying to dig into it but have pretty much run out of time this week.

It seems to me that in some case(s) before, uv callbacks may have been called twice before the next beforeExit, which could alter things at the very least like an addon that uses a uv_check_t handle?

@Fishrock123

Fishrock123 Sep 15, 2017

Member

Is everyone here sure this doesn't break something edge-casey with beforeExit and order of operations?

I'm trying to dig into it but have pretty much run out of time this week.

It seems to me that in some case(s) before, uv callbacks may have been called twice before the next beforeExit, which could alter things at the very least like an addon that uses a uv_check_t handle?

targos added a commit to targos/node that referenced this pull request Sep 19, 2017

deps: backport 6e9e2e5 from upstream V8
Original commit message:

  [heap] Move SweeperTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6655
  Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
  Reviewed-on: https://chromium-review.googlesource.com/595467
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47036}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 19, 2017

deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 19, 2017

deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@MylesBorins

This comment has been minimized.

Show comment
Hide comment
@MylesBorins

MylesBorins Sep 20, 2017

Member

I'm assuming that this is not applicable to the 6.x branch. Please let me know if I am mistaken

/cc @nodejs/v8 @nodejs/tsc

Member

MylesBorins commented Sep 20, 2017

I'm assuming that this is not applicable to the 6.x branch. Please let me know if I am mistaken

/cc @nodejs/v8 @nodejs/tsc

targos added a commit to targos/node that referenced this pull request Sep 21, 2017

deps: backport 6e9e2e5 from upstream V8
Original commit message:

  [heap] Move SweeperTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6655
  Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
  Reviewed-on: https://chromium-review.googlesource.com/595467
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47036}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 21, 2017

deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

targos added a commit to targos/node that referenced this pull request Sep 21, 2017

deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

PR-URL: nodejs#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

hferreiro added a commit to brave/node that referenced this pull request Sep 27, 2017

tracing: Update to use new Platform tracing apis
V8 modified the platform API to accept a tracing controller at platform
creation time that is required to be present for the lifetime of the
platform if tracing will every be enabled. This will simplify the
implementation of a v8::Platform subclass for node.

PR-URL: nodejs/node#14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

MylesBorins added a commit that referenced this pull request Sep 28, 2017

deps: backport 6e9e2e5 from upstream V8
Original commit message:

  [heap] Move SweeperTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6655
  Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
  Reviewed-on: https://chromium-review.googlesource.com/595467
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47036}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

MylesBorins added a commit that referenced this pull request Sep 28, 2017

deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

MylesBorins added a commit that referenced this pull request Sep 28, 2017

deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

MylesBorins added a commit that referenced this pull request Sep 29, 2017

deps: backport 6e9e2e5 from upstream V8
Original commit message:

  [heap] Move SweeperTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6655
  Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
  Reviewed-on: https://chromium-review.googlesource.com/595467
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47036}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

MylesBorins added a commit that referenced this pull request Sep 29, 2017

deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

MylesBorins added a commit that referenced this pull request Sep 29, 2017

deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

@MylesBorins MylesBorins referenced this pull request Oct 3, 2017

Merged

v8.7.0 proposal #15762

MylesBorins added a commit that referenced this pull request Oct 3, 2017

deps: backport 6e9e2e5 from upstream V8
Original commit message:

  [heap] Move SweeperTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6655
  Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
  Reviewed-on: https://chromium-review.googlesource.com/595467
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47036}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

MylesBorins added a commit that referenced this pull request Oct 3, 2017

deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

MylesBorins added a commit that referenced this pull request Oct 3, 2017

deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

Backport-PR-URL: #15393
PR-URL: #14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>

@davisjam davisjam referenced this pull request Sep 3, 2018

Open

WIP: Pluggable thread pool #22631

0 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment