--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABH6udaY82kLfuiFwJ9EEZys%3DWFftcDAqrzeTxdn9TON46%2BB0A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jw-m%3D3rCmYbFrkksASOJQPuLZeMB8q5z9yAyz5JEH0f7A%40mail.gmail.com.
Tests (unlike real code) do not have a top-level runloop — by default hey execute all of the code synchronously inside TestBody.
You received this message because you are subscribed to the Google Groups "scheduler-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scheduler-de...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/scheduler-dev/CALHg4nnwZ8dUE3vttD0ivvmaQSp2k8oY9QPJkoEHUwj_Ue_uGg%40mail.gmail.com.
Tests (unlike real code) do not have a top-level runloop — by default hey execute all of the code synchronously inside TestBody.Stupid question: Is it challenging to add a top-level runloop to tests by default?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jytNh_uTRZJzxS9gvnG1EhiNG7N%3DQV45Lvyserf6w63-Q%40mail.gmail.com.
The underlying problem is not just adding a top-level runloop but the fact that code in the test expects to run synchronously and the test finishes when the end of code block finishes.
Making all (or most) of the tests async sounds like a giant undertaking and without it top-level runloop wouldn't be useful.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/scheduler-dev/CABg10jyAME0Qh2M8MJYmZNffsFo38UP9yU9p5pbGfZSU%2B_9rZQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAH%3DT95QtYndxLmAmBDS4jbk_DDjRUuoj39BNyV6GRxm_3NxvcQ%40mail.gmail.com.
Yeah, it is possible, but I think that it's not something that we want.
Yeah, it is possible, but I think that it's not something that we want. Mostly becausea) this runloop is not going to be useful as the tasks won't have a chance to run before the test finishes anyway.b) it will turn all other runloops used by tests into nested ones, changing the behaviour (as we disable a few features for nested runloops — e.g. not running non-nestable tasks) in the ways we don't want.
c) it will make it easier to leak information across tests (by posting a task).I think that it's much easier for the test suite to let the GC logic know that it should scan the stack for pointers.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALHg4nnp8NKmy1BNoqOJqwS-0RQTwtbSmzXh6Qu34Pjuyr70Bw%40mail.gmail.com.
On Fri, Feb 14, 2020 at 12:08 AM Alexander Timin <alt...@chromium.org> wrote:Yeah, it is possible, but I think that it's not something that we want. Mostly becausea) this runloop is not going to be useful as the tasks won't have a chance to run before the test finishes anyway.b) it will turn all other runloops used by tests into nested ones, changing the behaviour (as we disable a few features for nested runloops — e.g. not running non-nestable tasks) in the ways we don't want.So that means we currently execute non-nestable tasks in those testing calls? If yes, that seems like another problem. If JS is run in tests, V8 may post non-nestable tasks to finalize garbage collections to avoid scanning the stack. For unified heap this means that V8 would tell Oilpan that it's safe to ignore the stack when finalizing GC through such a task.We could solve it by disabling non-nestable tasks through NonNestableTasksEnabled() for tests.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAH%2BmL5Av12JVzKx8Dm_JssDBtn7UdqB7gTocP_AOJ-mVzrp%3D3g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABH6udb%2BO%2Bt1HYbreScnEYGEdsx72%2BtbxCVNVrJGWx0C6SwG2w%40mail.gmail.com.
Could you point me to the place where we choose between HeapPointers and NoHeapPointers? I know about one check in GCTaskRunner, but I wonder if there is anything else?Tweaking this logic there seems like a good idea.
Could you point me to the place where we choose between HeapPointers and NoHeapPointers? I know about one check in GCTaskRunner, but I wonder if there is anything else?
Tweaking this logic there seems like a good idea.
Could you point me to the place where we choose between HeapPointers and NoHeapPointers? I know about one check in GCTaskRunner, but I wonder if there is anything else?
Tweaking this logic there seems like a good idea.
For this approach, Anton already has a workable solution. I thought that that is a bad hook-style design working around a real problem around tests & runloops and was wondering if the testing infrastructure should support a top-level runloop.However, after seeing the discussion on this thread, I'm convinced that the expectation is that tasks executed by RunPendingTasks() are run as if they are run in a top-level runloop. If that is the case, Anton's solution & Alexander's proposal sound reasonable. We should just make RunPendingTasks() tell Oilpan that the tasks executed there will have on-stack pointers.(Anton: I apologize my concern led to a bunch of exploration and we finally got back to your original solution.)
On Fri, Feb 14, 2020 at 2:21 AM Michael Lippautz <mlip...@chromium.org> wrote:Blink's no-GC scope can only work for Blink-local operations. It does not work when invoking JS operations or draining the task queue as with unified heap V8 is allowed to finalize a collection cycle as well.V8 has per-design never allowed a no-GC scope on its API level because there should be no way for the embedder to create a state where we cannot finalize. Same holds true for unified heap.(Especially, when invoking some non-trivial workload like RunLoop() that can execute anything we should allow GC to happen to catch as many issues as we can in tests.)On Fri, Feb 14, 2020 at 11:09 AM Alexander Timin <alt...@chromium.org> wrote:Could you point me to the place where we choose between HeapPointers and NoHeapPointers? I know about one check in GCTaskRunner, but I wonder if there is anything else?Tweaking this logic there seems like a good idea.I think Anton's initial question is how do we nicely allow GC and adjust GCTaskRunner to signal that we have pointers on the stack in the current RunLoop architecture.The V8 parts are here:V8 does check whether the embedder supports nested tasks which can be overridden in such scenarios.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxOfXBVj%2BxkqXWyU5bgGkX0RZoXYmuoywSksW2i%3DA3nGw%40mail.gmail.com.