Commit d7dd0f08 authored by epenner@chromium.org's avatar epenner@chromium.org

cc: Limit the total number of uploads.

We can't reference-count shared memory regions in the GPU
process, so we dup/map the memory block for each upload.
This doesn't scale for small uploads, both because we can
use too many file descriptors, and use too much address
space when the small upload transfer buffers are contained
in larger shared memory blocks.

This limits the total number of uploads to prevent the
problem, but this should be fixed properly and this limit
removed.

BUG=176002

NOTRY=True
Since it's a CC only change and unit tests have passed.


Review URL: https://chromiumcodereview.appspot.com/12260033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182400 0039d316-1c4b-4281-b951-d872f2087c98
parent ccb4feef
...@@ -30,8 +30,11 @@ namespace { ...@@ -30,8 +30,11 @@ namespace {
// For reference, the Nexus10 can upload 1MB in about 2.5ms. // For reference, the Nexus10 can upload 1MB in about 2.5ms.
// Assuming a three frame deep pipeline this implies ~20MB. // Assuming a three frame deep pipeline this implies ~20MB.
const int kMaxPendingUploadBytes = 20 * 1024 * 1024; const int kMaxPendingUploadBytes = 20 * 1024 * 1024;
// TODO(epenner): We should remove this upload limit (crbug.com/176197)
const int kMaxPendingUploads = 72;
#else #else
const int kMaxPendingUploadBytes = 100 * 1024 * 1024; const int kMaxPendingUploadBytes = 100 * 1024 * 1024;
const int kMaxPendingUploads = 1000;
#endif #endif
// Determine bin based on three categories of tiles: things we need now, // Determine bin based on three categories of tiles: things we need now,
...@@ -630,7 +633,8 @@ bool TileManager::CanDispatchRasterTask(Tile* tile) { ...@@ -630,7 +633,8 @@ bool TileManager::CanDispatchRasterTask(Tile* tile) {
return false; return false;
size_t new_bytes_pending = bytes_pending_set_pixels_; size_t new_bytes_pending = bytes_pending_set_pixels_;
new_bytes_pending += tile->bytes_consumed_if_allocated(); new_bytes_pending += tile->bytes_consumed_if_allocated();
return new_bytes_pending <= kMaxPendingUploadBytes; return new_bytes_pending <= kMaxPendingUploadBytes &&
tiles_with_pending_set_pixels_.size() < kMaxPendingUploads;
} }
void TileManager::DispatchMoreTasks() { void TileManager::DispatchMoreTasks() {
......
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