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

Issue 467058: Linux: Adjust /proc/pid/oom_adj to sacrifice plugin and renderer processes to... (Closed)

Created:
11 years ago by Lei Zhang
Modified:
11 years ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Linux: Adjust /proc/pid/oom_adj to sacrifice plugin and renderer processes to the OOM killer. BUG=29752 TEST=During out of memory conditions, Linux kernel picks a plugin/renderer over the browser process. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34222

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -14 lines) Patch
M base/process_util.h View 2 1 chunk +7 lines, -0 lines 0 comments Download
M base/process_util_linux.cc View 2 3 chunks +16 lines, -2 lines 0 comments Download
M chrome/app/chrome_dll_main.cc View 1 2 2 chunks +37 lines, -0 lines 0 comments Download
M chrome/browser/zygote_host_linux.h View 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/zygote_host_linux.cc View 2 6 chunks +30 lines, -11 lines 0 comments Download
A sandbox/linux/suid/process_util.h View 1 chunk +21 lines, -0 lines 0 comments Download
A sandbox/linux/suid/process_util_linux.c View 2 1 chunk +44 lines, -0 lines 2 comments Download
M sandbox/linux/suid/sandbox.c View 2 3 chunks +15 lines, -1 line 0 comments Download
M sandbox/sandbox.gyp View 2 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Lei Zhang
The scores are a bit arbitrary, let me know if you think they should be ...
11 years ago (2009-12-09 02:05:44 UTC) #1
agl
http://codereview.chromium.org/467058/diff/1/2 File chrome/app/chrome_dll_main.cc (right): http://codereview.chromium.org/467058/diff/1/2#newcode260 chrome/app/chrome_dll_main.cc:260: if (process_type == switches::kZygoteProcess || Zapping the Zygote is ...
11 years ago (2009-12-09 02:10:16 UTC) #2
Lei Zhang
On 2009/12/09 02:10:16, agl wrote: > http://codereview.chromium.org/467058/diff/1/2 > File chrome/app/chrome_dll_main.cc (right): > > http://codereview.chromium.org/467058/diff/1/2#newcode260 > ...
11 years ago (2009-12-09 08:36:49 UTC) #3
agl
On Wed, Dec 9, 2009 at 12:36 AM, <thestig@chromium.org> wrote: > Setting oom_adj for the ...
11 years ago (2009-12-09 16:03:40 UTC) #4
Evan Martin
If a renderer starts eating memory I won't the OOM killer will go after the ...
11 years ago (2009-12-09 16:32:32 UTC) #5
agl
On Wed, Dec 9, 2009 at 8:32 AM, <evan@chromium.org> wrote: > If a renderer starts ...
11 years ago (2009-12-09 17:52:01 UTC) #6
Lei Zhang
On 2009/12/09 16:32:32, Evan Martin wrote: > If a renderer starts eating memory I won't ...
11 years ago (2009-12-09 20:39:58 UTC) #7
agl
11 years ago (2009-12-09 21:19:14 UTC) #8
LGTM.

The SUID sandbox MUST DIE! (soon)

http://codereview.chromium.org/467058/diff/7001/7005
File sandbox/linux/suid/process_util_linux.c (right):

http://codereview.chromium.org/467058/diff/7001/7005#newcode23
sandbox/linux/suid/process_util_linux.c:23: char oom_adj[PATH_MAX];
Rather than use PATH_MAX here, it would be clearer if we had 6 /* "/proc/" */ +
20 /* log_2(2**64) */ + 9 /* "/oom_adj\0" */

http://codereview.chromium.org/467058/diff/7001/7005#newcode29
sandbox/linux/suid/process_util_linux.c:29: if (getuid() != statbuf.st_uid)
If one was being really careful one would open the directory, check the UID and
use openat to get the oom_adj. However, it's actually not worth it in this case.

Powered by Google App Engine
This is Rietveld 408576698