Commit 5e7a9dcc authored by Khushal's avatar Khushal Committed by Commit Bot

gpu: Remove PaintOpSerialization size uma and update default size.

The UMA was added to get data on how often we need to serialize ops >
512k and what the size distribution for these ops looks like. The data
from stable channels puts it at ~0.4 ops per million tiles, and even in
those cases ~85% of them fit within 600k and only 0.01% of the cases
exceeded the max limit of 16M. So it looks like this is enough of an
edge case that the current solution for reallocation on a serialization
failure is good enough.

This change removes the UMA since its no longer needed and increments the
default size we begin with to 600k so the common cases require minimum
reallocations.

R=enne@chromium.org, piman@chromium.org

Change-Id: I022ead6728c2b0a04bc898db892d3ccc4ac5d0e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1641810
Commit-Queue: Khushal <khushalsagar@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666025}
parent 8e87ef93
...@@ -91,21 +91,6 @@ namespace { ...@@ -91,21 +91,6 @@ namespace {
const uint32_t kMaxTransferCacheEntrySizeForTransferBuffer = 1024; const uint32_t kMaxTransferCacheEntrySizeForTransferBuffer = 1024;
void RecordPaintOpSize(size_t size) {
constexpr size_t kMinPaintOpSize = 512 * 1024;
constexpr size_t kMaxPaintOpSize = 16 * 1024 * 1024;
// Serialization failure, record max size.
if (size == 0u)
size = kMaxPaintOpSize;
if (size < kMinPaintOpSize)
return;
UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.OopRaster.PaintOpSerializationSize", size,
kMinPaintOpSize, kMaxPaintOpSize, 50);
}
} // namespace } // namespace
// Helper to copy data to the GPU service over the transfer cache. // Helper to copy data to the GPU service over the transfer cache.
...@@ -258,13 +243,11 @@ class RasterImplementation::PaintOpSerializer { ...@@ -258,13 +243,11 @@ class RasterImplementation::PaintOpSerializer {
} }
if (!size) { if (!size) {
RecordPaintOpSize(0u);
LOG(ERROR) << "Failed to serialize op in " << block_size << " bytes."; LOG(ERROR) << "Failed to serialize op in " << block_size << " bytes.";
return 0u; return 0u;
} }
} }
RecordPaintOpSize(size);
DCHECK_LE(size, free_bytes_); DCHECK_LE(size, free_bytes_);
DCHECK(base::CheckAdd<uint32_t>(written_bytes_, size).IsValid()); DCHECK(base::CheckAdd<uint32_t>(written_bytes_, size).IsValid());
......
...@@ -57,7 +57,9 @@ class RasterInterface : public InterfaceBase { ...@@ -57,7 +57,9 @@ class RasterInterface : public InterfaceBase {
const gfx::ColorSpace& color_space, const gfx::ColorSpace& color_space,
const GLbyte* mailbox) = 0; const GLbyte* mailbox) = 0;
static constexpr size_t kDefaultMaxOpSizeHint = 512 * 1024; // Heuristic decided on UMA data. This covers 85% of the cases where we need
// to serialize ops > 512k.
static constexpr size_t kDefaultMaxOpSizeHint = 600 * 1024;
virtual void RasterCHROMIUM(const cc::DisplayItemList* list, virtual void RasterCHROMIUM(const cc::DisplayItemList* list,
cc::ImageProvider* provider, cc::ImageProvider* provider,
const gfx::Size& content_size, const gfx::Size& content_size,
......
...@@ -45010,6 +45010,9 @@ uploading your change for review. ...@@ -45010,6 +45010,9 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="GPU.OopRaster.PaintOpSerializationSize" units="bytes"> <histogram name="GPU.OopRaster.PaintOpSerializationSize" units="bytes">
<obsolete>
Deprecated 06/2019.
</obsolete>
<owner>khushalsagar@chromium.org</owner> <owner>khushalsagar@chromium.org</owner>
<summary> <summary>
This records the number of bytes required to serialize a paint op for OOP This records the number of bytes required to serialize a paint op for OOP
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