New issue
Advanced search Search tips

Issue 611856 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 553459



Sign in to add a comment

Add PTHREAD_PRIO_INHERIT to POSIX Locks

Project Member Reported by robliao@chromium.org, May 13 2016

Issue description

The Browser Task Scheduler will be using thread priorities. PTHREAD_PRIO_INHERIT will help avoid priority inversion with the use of thread priorities.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/206071838287c145e6a71f57744fd47bf24d614b

commit 206071838287c145e6a71f57744fd47bf24d614b
Author: robliao <robliao@chromium.org>
Date: Mon Aug 01 20:59:42 2016

Add PTHREAD_PRIO_INHERIT Locks for Mac

The Browser Task Scheduler will be using thread priorities.
PTHREAD_PRIO_INHERIT will help avoid priority inversion with the use of thread
priorities on Mac.

Linux currently cannot use them due to security concerns in the kernel priority
inheritance futex.

BUG= 611856 

Review-Url: https://codereview.chromium.org/2178503003
Cr-Commit-Position: refs/heads/master@{#409052}

[modify] https://crrev.com/206071838287c145e6a71f57744fd47bf24d614b/base/synchronization/lock.h
[modify] https://crrev.com/206071838287c145e6a71f57744fd47bf24d614b/base/synchronization/lock_impl.h
[modify] https://crrev.com/206071838287c145e6a71f57744fd47bf24d614b/base/synchronization/lock_impl_posix.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d84dc069a147eb0209b9f7713beafb3de0dec26b

commit d84dc069a147eb0209b9f7713beafb3de0dec26b
Author: fdoray <fdoray@chromium.org>
Date: Thu Aug 04 20:36:26 2016

Add Lock::HandlesMultipleThreadPriorities().

This static method is available on all platform. It replaces
Lock::PriorityInheritanceAvailable(). It will simplify code
that checks whether priority inversion will be mitigated when
Lock is used from different thread priorities.

E.g.:

  if (Lock::Lock::PriorityInheritanceAvailable())
    PlatformThread::SetCurrentThreadPriority(...);

Becomes:

  if (Lock::HandlesMultipleThreadPriorities())
    PlatformThread::SetCurrentThreadPriority(...);

BUG= 611856 

Review-Url: https://codereview.chromium.org/2206263002
Cr-Commit-Position: refs/heads/master@{#409890}

[modify] https://crrev.com/d84dc069a147eb0209b9f7713beafb3de0dec26b/base/synchronization/lock.h

Comment 3 by gab@chromium.org, Aug 9 2016

Status: Fixed (was: Started)
Works as much as possible (i.e. on Mac -- see PriorityInheritanceAvailable() for details).

Sign in to add a comment