Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Issue 434803003: Linux, Android: fix call to setpriority(2). (Closed)

Created:
6 years, 4 months ago by jln (very slow on Chromium)
Modified:
6 years, 4 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Linux, Android: fix call to setpriority(2). setpriority(), when used with PRIO_PROCESS, should affect the whole process (i.e. thread group). On Linux the system call only affects one thread (this bug is documented in http://man7.org/linux/man-pages/man2/getpriority.2.html) and thus lets the caller specify a tid. This CL changes the call to setpriority(PRIO_PROCESS, tid, ...) to setpriority(PRIO_PROCESS, 0, ...), which is strictly equivalent, albeit slightly more correct. This makes filtering system calls in our sandbox easier, as the current thread id is not known to the BPF filter. BUG=399473 R=mdempsky@chromium.org, willchan@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286964

Patch Set 1 #

Total comments: 2

Patch Set 2 : Only substitute the thread id with 0 when appropriate. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -13 lines) Patch
M base/threading/platform_thread_android.cc View 1 1 chunk +11 lines, -5 lines 0 comments Download
M base/threading/platform_thread_linux.cc View 1 1 chunk +13 lines, -8 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
jln (very slow on Chromium)
Matthew: could you please take a look?
6 years, 4 months ago (2014-08-01 00:01:56 UTC) #1
mdempsky
https://chromiumcodereview.appspot.com/434803003/diff/1/base/threading/platform_thread_android.cc File base/threading/platform_thread_android.cc (right): https://chromiumcodereview.appspot.com/434803003/diff/1/base/threading/platform_thread_android.cc#newcode74 base/threading/platform_thread_android.cc:74: if (setpriority(PRIO_PROCESS, 0, kNiceSetting)) Can SetThreadPriority() be called by ...
6 years, 4 months ago (2014-08-01 00:05:32 UTC) #2
willchan no longer on Chromium
Let me know if you substantially change anything, but otherwise, this LGTM from a base/OWNERS ...
6 years, 4 months ago (2014-08-01 00:09:18 UTC) #3
jln (very slow on Chromium)
Matthew: please take another look! (and send to CQ if you're happy). https://chromiumcodereview.appspot.com/434803003/diff/1/base/threading/platform_thread_android.cc File base/threading/platform_thread_android.cc ...
6 years, 4 months ago (2014-08-01 00:39:53 UTC) #4
mdempsky
lgtm
6 years, 4 months ago (2014-08-01 00:42:06 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jln@chromium.org/434803003/20001
6 years, 4 months ago (2014-08-01 00:44:59 UTC) #6
jln (very slow on Chromium)
6 years, 4 months ago (2014-08-01 07:51:43 UTC) #7
Message was sent while issue was closed.
Committed patchset #2 manually as r286964 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698