New issue
Advanced search Search tips

Issue 839110 link

Starred by 3 users

Issue metadata

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

Blocked on:
issue 831835

Blocking:
issue 832079
issue 728208



Sign in to add a comment

[Feature] More aggressively throttle TaskPriority::BACKGROUND tasks

Project Member Reported by gab@chromium.org, May 2 2018

Issue description

Currently BACKGROUND tasks are executing in a background worker pool. Unfortunately not all platforms support proper background thread priority [1].

On those platforms TaskScheduler needs to more aggressively throttle BACKGROUND tasks by moving everything into one pool and having a quota on how many workers BACKGROUND tasks can use even when idle (to avoid having a starved pool when foreground work comes in).

Step #1 is to resolve issue 831835 to ensure no BACKGROUND work is required to startup + navigate.
In parallel with step #1 we can strip the background pool on platforms that don't support background threads.

Then:
 - Add ScopedNoBackgroundTasks() for max responsiveness situations like startup or incoming-scroll.
 - Enable aggressive backgrounding.

[1]
ThreadPriority SchedulerWorker::GetDesiredThreadPriority() const {
  // All threads have a NORMAL priority when Lock doesn't handle multiple thread
  // priorities.
  if (!Lock::HandlesMultipleThreadPriorities())
    return ThreadPriority::NORMAL;
  ...
}

As of today Lock::HandlesMultipleThreadPriorities() is only true on Mac/Windows (i.e. not Android/Linux/etc.).
 

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

Blocking: 728208
Cc: skyos...@chromium.org
Blocking: 832079
Components: Internals>TaskScheduler

Sign in to add a comment