Commit 9f2dce88 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Fix code publish limits

The idea was to distribute the publish limits to reduce the chance that
different tasks are publishing at the same time. We always used the same
task_id to compute the limits though, so all queues had the same limit.
This CL fixes that by using the task id of the respective queue.

R=thibaudm@chromium.org

Change-Id: I5231aa35b2b53d625fafbb2130b886390fb7d38a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2502292Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70898}
parent aad7b7ff
......@@ -159,10 +159,12 @@ class CompilationUnitQueues {
// times.
int units_per_thread = num_declared_functions_ / num_queues;
int min = std::max(10, units_per_thread / 8);
int queue_id = 0;
for (auto& queue : queues_) {
// Set a limit between {min} and {2*min}, but not smaller than {10}.
int limit = min + (min * task_id / num_queues);
int limit = min + (min * queue_id / num_queues);
queue->publish_limit.store(limit, std::memory_order_relaxed);
++queue_id;
}
return queues_[task_id].get();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment