Commit d8f13fad authored by Kenneth Russell's avatar Kenneth Russell Committed by Commit Bot

Increase GPU sandbox limit up to 64 GB.

Some high-end web applications need to be able to upload more data to
the GPU than the GPU process's current 16 GB sandbox limit allows. (At
least some of the data uploaded to the GPU is shadowed in CPU memory.)

Bug: 1094750
Change-Id: I3c24584d0723f74df9ad561f34e33478b314bdba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2274666Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarAlex Gough <ajgo@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784208}
parent 0a8b274a
......@@ -434,9 +434,16 @@ rlim_t GetProcessDataSizeLimit(SandboxType sandbox_type) {
sandbox_type == SandboxType::kRenderer) {
// Allow the GPU/RENDERER process's sandbox to access more physical memory
// if it's available on the system.
//
// Renderer processes are allowed to access 16 GB; the GPU process, up
// to 64 GB.
constexpr rlim_t GB = 1024 * 1024 * 1024;
const rlim_t physical_memory = base::SysInfo::AmountOfPhysicalMemory();
if (physical_memory > 16 * GB) {
if (sandbox_type == SandboxType::kGpu && physical_memory > 64 * GB) {
return 64 * GB;
} else if (sandbox_type == SandboxType::kGpu && physical_memory > 32 * GB) {
return 32 * GB;
} else if (physical_memory > 16 * GB) {
return 16 * GB;
} else if (physical_memory > 8 * GB) {
return 8 * GB;
......
......@@ -598,8 +598,15 @@ sandbox::ResultCode SetJobMemoryLimit(const base::CommandLine& cmd_line,
int64_t GB = 1024 * 1024 * 1024;
// Allow the GPU/RENDERER process's sandbox to access more physical memory
// if it's available on the system.
//
// Renderer processes are allowed to access 16 GB; the GPU process, up
// to 64 GB.
int64_t physical_memory = base::SysInfo::AmountOfPhysicalMemory();
if (physical_memory > 16 * GB) {
if (sandbox_type == SandboxType::kGpu && physical_memory > 64 * GB) {
memory_limit = 64 * GB;
} else if (sandbox_type == SandboxType::kGpu && physical_memory > 32 * GB) {
memory_limit = 32 * GB;
} else if (physical_memory > 16 * GB) {
memory_limit = 16 * GB;
} else if (physical_memory > 8 * GB) {
memory_limit = 8 * GB;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment