Chromium Code Reviews| Index: content/browser/zygote_host_linux.cc |
| diff --git a/content/browser/zygote_host_linux.cc b/content/browser/zygote_host_linux.cc |
| index 42ee6da5c0f270fb353e2f78e46ecb0c1ef22213..89a39d5630e33b53b68e79910f135e33f35a175c 100644 |
| --- a/content/browser/zygote_host_linux.cc |
| +++ b/content/browser/zygote_host_linux.cc |
| @@ -272,28 +272,33 @@ pid_t ZygoteHost::ForkRequest( |
| return base::kNullProcessHandle; |
| } |
| - const int kRendererScore = 5; |
| + // This is just a starting score for a renderer or extension (the |
| + // only types of processes that will be started this way). It will |
| + // get adjusted as time goes on. |
| + const int kRendererScore = 300; |
|
stevenjb
2011/08/18 00:20:07
One class to rule them all?
Greg Spencer (Chromium)
2011/08/18 23:10:50
OK, moved this to common/chrome_constants.h
|
| AdjustRendererOOMScore(pid, kRendererScore); |
| return pid; |
| } |
| void ZygoteHost::AdjustRendererOOMScore(base::ProcessHandle pid, int score) { |
| - // 1) You can't change the oom_adj of a non-dumpable process (EPERM) unless |
| - // you're root. Because of this, we can't set the oom_adj from the browser |
| - // process. |
| + // 1) You can't change the oom_score_adj of a non-dumpable process |
| + // (EPERM) unless you're root. Because of this, we can't set the |
| + // oom_adj from the browser process. |
| // |
| - // 2) We can't set the oom_adj before entering the sandbox because the |
| - // zygote is in the sandbox and the zygote is as critical as the browser |
| - // process. Its oom_adj value shouldn't be changed. |
| + // 2) We can't set the oom_score_adj before entering the sandbox |
| + // because the zygote is in the sandbox and the zygote is as |
| + // critical as the browser process. Its oom_adj value shouldn't |
| + // be changed. |
| // |
| - // 3) A non-dumpable process can't even change its own oom_adj because it's |
| - // root owned 0644. The sandboxed processes don't even have /proc, but one |
| - // could imagine passing in a descriptor from outside. |
| + // 3) A non-dumpable process can't even change its own oom_score_adj |
| + // because it's root owned 0644. The sandboxed processes don't |
| + // even have /proc, but one could imagine passing in a descriptor |
| + // from outside. |
| // |
| // So, in the normal case, we use the SUID binary to change it for us. |
| // However, Fedora (and other SELinux systems) don't like us touching other |
| - // process's oom_adj values |
| + // process's oom_score_adj values |
| // (https://bugzilla.redhat.com/show_bug.cgi?id=581256). |
| // |
| // The offical way to get the SELinux mode is selinux_getenforcemode, but I |