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

Issue 2334533002: base: Move renderer threads to the appropriate cpuset. (Closed)

Created:
4 years, 3 months ago by reveman
Modified:
4 years, 3 months ago
CC:
blink-worker-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, gab, jam, kinuko+watch, mlamouri+watch-content_chromium.org, Takashi Toyoshima
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

base: Allow renderer thread priorities to be changed. This provides a mechanism for a renderer to change the priority of its threads and as a result also the cpuset they are assigned to. A ChildProcessHost IPC message from the renderer is used to request a thread priority change and have the browser process identify the renderer thread that is requesting a priority change by checking all its threads to find a thread with NSpid field in /proc/[pid]/task/[thread_id]/status that matches the namespace tid from the renderer. This is currently limited to Linux and ChromeOS but follow up work will investigate the possibility and benefits of doing the same on other platforms. Note: Thread priorities in the renderer are already adjusted in a similar way on Android as the sandbox is not strict enough to prevent this on Android today. BUG=chrome-os-partner:56550 TEST= Committed: https://crrev.com/7b97c3240fb3da0826f244f9b592fc1761fb6554 Cr-Commit-Position: refs/heads/master@{#419649}

Patch Set 1 #

Total comments: 2

Patch Set 2 : rebase #

Patch Set 3 : base: Set priority of renderer threads. #

Patch Set 4 : fix io thread issue #

Patch Set 5 : v3 #

Total comments: 8

Patch Set 6 : loops #

Patch Set 7 : more ifdefs #

Patch Set 8 : allow io #

Patch Set 9 : use file thread #

Total comments: 8

Patch Set 10 : rebase and address feedback #

Total comments: 5

Patch Set 11 : address feedback #

Patch Set 12 : revert to CHECK_NE #

Unified diffs Side-by-side diffs Delta from patch set Stats (+247 lines, -23 lines) Patch
M base/linux_util.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M base/linux_util.cc View 1 2 3 4 5 8 4 chunks +68 lines, -23 lines 0 comments Download
M base/threading/platform_thread.h View 1 2 3 4 5 6 7 8 9 1 chunk +14 lines, -0 lines 0 comments Download
M base/threading/platform_thread_linux.cc View 1 2 3 4 5 6 7 8 9 11 4 chunks +60 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.h View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 3 4 5 6 7 8 3 chunks +38 lines, -0 lines 0 comments Download
M content/child/child_process.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M content/child/child_process.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -0 lines 0 comments Download
M content/child/child_thread_impl.h View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M content/child/child_thread_impl.cc View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M content/common/child_process_messages.h View 1 2 3 4 5 6 3 chunks +16 lines, -0 lines 0 comments Download
M content/renderer/categorized_worker_pool.h View 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 2 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (22 generated)
Dmitry Torokhov
https://codereview.chromium.org/2334533002/diff/1/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/2334533002/diff/1/base/threading/platform_thread_linux.cc#newcode73 base/threading/platform_thread_linux.cc:73: FILE_PATH_LITERAL("/sys/fs/cgroup/cpuset/chrome"); I wonder if, instead of having static cpuset ...
4 years, 3 months ago (2016-09-12 16:18:09 UTC) #2
reveman
+avi for content/ +thakis for base/ +jschuh for *_messages.h and general security review https://codereview.chromium.org/2334533002/diff/1/base/threading/platform_thread_linux.cc File ...
4 years, 3 months ago (2016-09-16 22:16:11 UTC) #7
Avi (use Gerrit)
lgtm ok https://codereview.chromium.org/2334533002/diff/80001/base/linux_util.cc File base/linux_util.cc (right): https://codereview.chromium.org/2334533002/diff/80001/base/linux_util.cc#newcode168 base/linux_util.cc:168: i = tids.begin(); i != tids.end(); ++i) ...
4 years, 3 months ago (2016-09-16 22:26:29 UTC) #8
reveman
thanks for the quick review! https://codereview.chromium.org/2334533002/diff/80001/base/linux_util.cc File base/linux_util.cc (right): https://codereview.chromium.org/2334533002/diff/80001/base/linux_util.cc#newcode168 base/linux_util.cc:168: i = tids.begin(); i ...
4 years, 3 months ago (2016-09-16 23:06:41 UTC) #9
Avi (use Gerrit)
https://codereview.chromium.org/2334533002/diff/80001/base/threading/platform_thread.h File base/threading/platform_thread.h (right): https://codereview.chromium.org/2334533002/diff/80001/base/threading/platform_thread.h#newcode213 base/threading/platform_thread.h:213: #endif On 2016/09/16 23:06:41, reveman wrote: > On 2016/09/16 ...
4 years, 3 months ago (2016-09-17 00:55:54 UTC) #10
reveman
https://codereview.chromium.org/2334533002/diff/80001/base/threading/platform_thread.h File base/threading/platform_thread.h (right): https://codereview.chromium.org/2334533002/diff/80001/base/threading/platform_thread.h#newcode213 base/threading/platform_thread.h:213: #endif On 2016/09/17 at 00:55:54, Avi wrote: > On ...
4 years, 3 months ago (2016-09-17 09:13:36 UTC) #11
Nico
We used to have an api similar to this but removed it in https://codereview.chromium.org/1193303002 'cause ...
4 years, 3 months ago (2016-09-19 20:49:30 UTC) #24
reveman
On 2016/09/19 at 20:49:30, thakis wrote: > We used to have an api similar to ...
4 years, 3 months ago (2016-09-19 21:43:39 UTC) #25
Nico
Thanks, that makes sense, lgtm. Maybe mention some of what you just said in the ...
4 years, 3 months ago (2016-09-19 21:46:11 UTC) #26
reveman
On 2016/09/19 at 21:46:11, thakis wrote: > Thanks, that makes sense, lgtm. Maybe mention some ...
4 years, 3 months ago (2016-09-19 21:58:33 UTC) #28
reveman
+tsepez for *_messages.h
4 years, 3 months ago (2016-09-19 22:39:43 UTC) #30
Tom Sepez
https://codereview.chromium.org/2334533002/diff/180001/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/2334533002/diff/180001/base/threading/platform_thread_linux.cc#newcode140 base/threading/platform_thread_linux.cc:140: CHECK_NE(thread_id, getpid()); Since this is running in the browser ...
4 years, 3 months ago (2016-09-19 22:54:04 UTC) #31
Tom Sepez
LGTM otherwise
4 years, 3 months ago (2016-09-19 22:54:32 UTC) #32
Nico
https://codereview.chromium.org/2334533002/diff/180001/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/2334533002/diff/180001/base/threading/platform_thread_linux.cc#newcode140 base/threading/platform_thread_linux.cc:140: CHECK_NE(thread_id, getpid()); On 2016/09/19 22:54:04, Tom Sepez wrote: > ...
4 years, 3 months ago (2016-09-19 23:01:46 UTC) #33
reveman
Thanks for quick reviews. https://codereview.chromium.org/2334533002/diff/180001/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/2334533002/diff/180001/base/threading/platform_thread_linux.cc#newcode140 base/threading/platform_thread_linux.cc:140: CHECK_NE(thread_id, getpid()); On 2016/09/19 at ...
4 years, 3 months ago (2016-09-19 23:14:22 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2334533002/220001
4 years, 3 months ago (2016-09-19 23:15:40 UTC) #37
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 3 months ago (2016-09-20 02:11:22 UTC) #38
commit-bot: I haz the power
4 years, 3 months ago (2016-09-20 02:12:42 UTC) #40
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/7b97c3240fb3da0826f244f9b592fc1761fb6554
Cr-Commit-Position: refs/heads/master@{#419649}

Powered by Google App Engine
This is Rietveld 408576698