- 13 Apr, 2022 1 commit
-
-
Nikolaos Papaspyrou authored
Tracer scopes are used in numerous places in src/heap to track time spent during various phases of the garbage collection. Usually, they are introduced with the TRACE_GC* family of macros, taking the scope identifier as a parameter. At most call sites, the scope identifier is known at compile time. This CL inlines the constructor and destructor of GCTracer::Scope, in order to enable the C++ compiler to properly optimize the introduction of such scopes when the scope identifier is known at compile time, using constant propagation. This is expected to have a performance impact for short-lived and frequently used scopes, e.g., in incremental marking and sweeping steps. Change-Id: I6f1a2954a437de1fa6dab5e464c20c952d84ffd4 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3581774Reviewed-by: Omer Katz <omerkatz@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org> Cr-Commit-Position: refs/heads/main@{#79957}
-
- 13 Sep, 2021 1 commit
-
-
Michael Lippautz authored
The refactoring is triggered by https://crrev.com/c/3121905 where we noticed that a bunch of tricky counter paths could be simplified, making reasoning about corectness easier. In this CL: 1. Use uniqe_ptr instead of Optional to allow moving SweepingJob away from the header file. 2. sweeping_in_progress_ is replaced with simply checking for a job. 3. freed_bytes_ are moved to the job and the dependency is reversed, avoiding the inside-out (Job->Sweeper) dependency completely. 4. Merge() and counter updates are merged into a Finalize() method. 5. FinishIfDone() allows for conditional finization. 6. young_bytes_ and old_bytes_ are removed as they were always updated when the corresponding bytes in the ArrayBufferList was updated. Change-Id: I56e5b04087166ce03d3a9195ac48359122a84c73 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3124776Reviewed-by: Dominik Inführ <dinfuehr@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/main@{#76795}
-
- 26 Aug, 2021 1 commit
-
-
Michael Lippautz authored
The array buffer sweeper has its own freed counter which is migrated back to a global counter. There exist two paths for finalizing array buffer sweeping which both need to merge back the counters. If we miss out on merging back the counter, the freed counter may overflow in the next cycle. Bug: chromium:1241332 Change-Id: Ic985f72414198de2eaf900b8e2e9b39bed24d87e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3121905Reviewed-by: Hannes Payer <hpayer@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/main@{#76503}
-
- 20 Aug, 2021 1 commit
-
-
Michael Lippautz authored
Avoids emitting scopes when not even running. This can be a problem for metrics computation which may recursively invoke EnsureSweepingCompleted() when starting marking even though the sweeper is guaranteed to be not running at this point. Bug: chromium:1211795 Change-Id: I8d7692f4e8c640f38d3c52df5c111fff4f06df9e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3109674 Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Auto-Submit: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Omer Katz <omerkatz@chromium.org> Cr-Commit-Position: refs/heads/main@{#76411}
-
- 27 May, 2021 1 commit
-
-
Dominik Inführ authored
The counter as size_t can legitimately overflow on 32-bit systems, since decreasing the counters is performed after all backing stores were freed on a background thread. Before sweeping is finished a new backing store could already be allocated which then leads to the overflow. Bug: v8:11788, chromium:1211437 Change-Id: Id9f3e58b0e84e831fe47109f7deb3a05ae7e489c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2922242 Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#74836}
-
- 07 May, 2021 1 commit
-
-
Dominik Inführ authored
This CL changes the accounting of array buffers, such that Detach deducts the backing store immediately. Previously this was corrected in the next GC cycle. Not updating backing_store_bytes_ immediately could cause an overflow in WasmMemoryObject::Grow. Grow first detaches the backing store from the old JSArrayBuffer and then attaches it to a new one. This results in the backing store being accounted twice temporarily, this could cause overflows on 32-bit systems. Bug: chromium:1204455 Change-Id: I7cf2ca9a12bb5caf7bcffa25a34567774cf155b8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2871458 Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#74429}
-
- 16 Dec, 2020 1 commit
-
-
Dominik Inführ authored
This CL completes sweeping in Heap::PerformGarbageCollection before invoking the actual collection. Collection code can now assume that sweeping was already finished. This helps with emitting the right epoch for sweeping and avoids a data-race when updating the epoch while sweeping tasks are still running. Bug: chromium:1154636 Change-Id: Ic9c4ac49568199d0ea48f17eea132079defe74a5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2573478 Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Hannes Payer <hpayer@chromium.org> Cr-Commit-Position: refs/heads/master@{#71794}
-
- 01 Dec, 2020 2 commits
-
-
Clemens Backes authored
This reverts commit be52501d. Reason for revert: Multiple TSan issues: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN/34457/overview (and others) Original change's description: > [heap] Add epoch to GC tracing events > > This CL adds the TRACE_GC_EPOCH macro, which adds the epoch as attribute > to the trace event. Use TRACE_GC_EPOCH for top-level events, nested > events can get the information from its parent. > > V8's GC needs an epoch for young and full collections, since scavenges > also occur during incremental marking. The epoch is also process-wide, > so different isolates do not reuse the same id. > > Change-Id: I8889bccce51e008374b4796445a50062bd87a45d > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565247 > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org> > Cr-Commit-Position: refs/heads/master@{#71521} TBR=ulan@chromium.org,dinfuehr@chromium.org Change-Id: I8219595f0751de84cbea7e047ef21aa95da32f07 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567696Reviewed-by: Clemens Backes <clemensb@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/master@{#71523}
-
Dominik Inführ authored
This CL adds the TRACE_GC_EPOCH macro, which adds the epoch as attribute to the trace event. Use TRACE_GC_EPOCH for top-level events, nested events can get the information from its parent. V8's GC needs an epoch for young and full collections, since scavenges also occur during incremental marking. The epoch is also process-wide, so different isolates do not reuse the same id. Change-Id: I8889bccce51e008374b4796445a50062bd87a45d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565247 Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#71521}
-
- 30 Nov, 2020 1 commit
-
-
Dominik Inführ authored
Change-Id: I5a42e582bec48a0f10f4914295e0c9a267e37b57 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565518Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/master@{#71507}
-
- 27 Nov, 2020 1 commit
-
-
Dominik Inführ authored
Remove TRACE_BACKGROUND_GC which was used to emit events on the background thread. It is replaced by TRACE_GC1, which uses the ThreadKind argument to work both on main and background threads. This CL also removes the dedicated BackgroundScope enum, all scopes are now in GCTracer::Scope. Change-Id: Ie377082d6a278dd46f2fa359611fdd99a08afcea Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2560203Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/master@{#71458}
-
- 29 Oct, 2020 1 commit
-
-
Dominik Inführ authored
Merge the list of concurrently swept ArrayBufferExtensions sooner back to the main thread. When appending a new ArrayBufferExtension check whether the concurrent sweeping was already finished and merge the lists if it is. In order to reduce the number of GCs in the linked test case, reset young_bytes_ and old_bytes_ to 0 while sweeping the ArrayBufferExtensions. Surviving extensions will be accounted again when merging lists. As a drive-by change remove scavenge.process_array_buffers from GCTracer. GCTracer also printed the wrong value for fast_promote. Bug: v8:11044 Change-Id: I8a772df895c43a69493015f42336c6f33fe52056 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2505764Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/master@{#70880}
-
- 12 Aug, 2020 1 commit
-
-
Dominik Inführ authored
ArrayBufferTracker was superseded by ArrayBufferList and ArrayBufferSweeper. Now that ArrayBufferSweeper is used in production, we can remove the unused ArrayBufferTracker mechanism. Bug: v8:10064 Change-Id: I479169c76b6c5c634672024f77e689bb64a36504 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2339105Reviewed-by: Simon Zünd <szuend@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/master@{#69351}
-
- 11 Feb, 2020 1 commit
-
-
Dominik Inführ authored
Before this CL array buffer counters were only decremented at the next GC. This CL makes freed_bytes_ an atomic variable which is incremented by the concurrent sweeping task. The main thread now also inspects this value when adding new JSArrayBuffers to update counters sooner. Bug: v8:10064 Change-Id: Ibcb245b541e806b95a3c2c42d3cc3affe7739e4d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2047043 Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#66221}
-
- 10 Feb, 2020 3 commits
-
-
Dominik Inführ authored
Add CHECKs to make sure that ArrayBufferSweeper is only active when v8_enable_array_buffer_extension is set to true. Bug: v8:10064 Change-Id: I609d5e1230dca52fd8555d4401c3f60faf4c266c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2047047Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/master@{#66209}
-
Dominik Inführ authored
Introduce separate counters for young and old array buffer bytes. They are used to keep the counter stable during sweeping when the array buffer lists are moved to the concurrent thread for sweeping. Bug: v8:10064 Change-Id: I0f11a634341873b4d21759c284c55beb26fe30a5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2045511 Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#66204}
-
Dominik Inführ authored
Update external memory counters when using ArrayBufferExtensions. In case the array buffers are swept concurrently, the counters are updated at the beginning of the next minor/full GC. A subsequent GC is going to update counters faster. ArrayBufferExtension now stores the accounting_length such that the sweeper always knows how much memory to deduct from the external memory on destruction. ArrayBufferList now also tracks the size of all ArrayBuffers in it. Bug: v8:10064 Change-Id: I50a8b1180aa837b6932f834df1610255bd2bd9fd Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2041441 Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#66195}
-
- 27 Jan, 2020 1 commit
-
-
Dominik Inführ authored
RequestSweep started an array buffer sweeping task even when there was no work. Bug: chromium:1045937 Change-Id: Ieb0835284f898dbc9b899d2b4118d9f7f6108a6f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020961 Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#66004}
-
- 24 Jan, 2020 1 commit
-
-
Dominik Inführ authored
When ArrayBufferExtensions are enabled, sweep the extensions outside of the GC pause concurrently to the application. The following GC will make sure that the previous concurrent sweep operation is finished. This CL introduces Heap::array_buffer_sweeper() that is both responsible for tracking all extensions but also for sweeping. Bug: v8:10064 Change-Id: I113cd625445a7d59ffb7a9de8b25a15a72b02b99 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010107Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/master@{#65984}
-