New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 814783 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature



Sign in to add a comment

[Feature] TaskScheduler should try to run USER_BLOCKING tasks on BIG cores on ARM

Project Member Reported by gab@chromium.org, Feb 22 2018

Issue description

Anecdotally, foreground TaskScheduler workers are assigned to little cores on ARM. This is problematic as renderers use them as support for the main thread (and main thread will block on them when it is out of shared work in parallel phases).

The main thread usually gets a BIG core.

Power wise it shouldn't matter to use all BIG cores when one BIG core is active.

First I will experiment with creating the renderer foreground workers at ThreadPriority::DISPLAY to see what impact that has. Then we can assess best long-term solution.
 

Comment 1 by gab@chromium.org, May 2 2018

Cc: gab@chromium.org stephen....@arm.com
Labels: -Type-Bug -M-66 Type-Feature
Owner: ----
Status: Available (was: Started)
Summary: [Feature] TaskScheduler should try to run USER_BLOCKING tasks BIG cores on ARM (was: Foreground scheduler workers should ideally be on BIG cores on ARM.)
Discussed with Stephen Kyle (ARM) @ Blink On 9.

The problem is we can't indicate this temporary dependency of the main thread to the OS.

FWIU, the governor doesn't take thread priority into account but rather some threads can have a multiplier which influences a thread's workload's count towards the quota that ends up heuristically labeling a thread as "must run on BIG"

In Chrome, Android/CrOS use cgroups to put threads explicitly labeled as ThreadPriority::DISPLAY into a special group that boosts its workload's contribution towards "doing important work / must run on BIG".

But, even if we used priority inheritance mutexes to indicate the main thread being blocked on a worker thread. It might raise the priority of the thread (and it could also put it in the group of "workload on this thread should count more") but it wouldn't immediately promote it to BIG even though the blocked main thread is set to run on BIG... (arguably a kernel issue..?).

We also don't wait to blindly label SchedulerWorkers as ThreadPriority::DISPLAY to be in the aforementioned cgroup as not all workload is USER_BLOCKING on a worker thread and it would be wrong to hint the kernel that this thread should always run on BIG...

The "solution" would be for TaskScheduler to have a whole separate set of threads for USER_BLOCKING work (and of course only schedule enough threads at once for the machine's capacity)...

Requiring 2X the number of threads is sad. I still think the best way to solve this would be for the kernel to expose a way to tell it a thread depends on another from user mode...

But as Stephen and I discussed we also haven't proven these priority inversions are a real problem in the wild (i.e. regularly skip frames because of it). The traces I provided had the inversion resolve within ~4ms.

@V8 GC: We should add a UMA metric of how long the main thread waits for workers in the wild after completing its chunk of the workload.

Comment 2 by gab@chromium.org, May 2 2018

Summary: [Feature] TaskScheduler should try to run USER_BLOCKING tasks on BIG cores on ARM (was: [Feature] TaskScheduler should try to run USER_BLOCKING tasks BIG cores on ARM)

Sign in to add a comment