Commit 11bd505a authored by Thiabaud Engelbrecht's avatar Thiabaud Engelbrecht Committed by Commit Bot

Record if large discardable memory allocations are from IPC or Freelist

Bug: 1134257
Change-Id: I7a5da462acc3031fbe940345c907db1abfb1d11a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441946Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Commit-Queue: Thiabaud Engelbrecht <thiabaud@google.com>
Cr-Commit-Position: refs/heads/master@{#813753}
parent 4e7a9cbf
...@@ -298,6 +298,11 @@ ClientDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory( ...@@ -298,6 +298,11 @@ ClientDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory(
free_span->set_is_locked(true); free_span->set_is_locked(true);
if (pages >= allocation_pages) {
UMA_HISTOGRAM_BOOLEAN("Memory.Discardable.LargeAllocationFromFreelist",
true);
}
// Memory usage is guaranteed to have changed after having removed // Memory usage is guaranteed to have changed after having removed
// at least one span from the free lists. // at least one span from the free lists.
MemoryUsageChanged(heap_->GetSize(), heap_->GetSizeOfFreeLists()); MemoryUsageChanged(heap_->GetSize(), heap_->GetSizeOfFreeLists());
...@@ -357,6 +362,11 @@ ClientDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory( ...@@ -357,6 +362,11 @@ ClientDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory(
heap_->MergeIntoFreeLists(std::move(leftover)); heap_->MergeIntoFreeLists(std::move(leftover));
} }
if (pages >= allocation_pages) {
UMA_HISTOGRAM_BOOLEAN("Memory.Discardable.LargeAllocationFromFreelist",
false);
}
MemoryUsageChanged(heap_->GetSize(), heap_->GetSizeOfFreeLists()); MemoryUsageChanged(heap_->GetSize(), heap_->GetSizeOfFreeLists());
auto discardable_memory = auto discardable_memory =
......
...@@ -7930,6 +7930,11 @@ Called by update_bad_message_reasons.py.--> ...@@ -7930,6 +7930,11 @@ Called by update_bad_message_reasons.py.-->
<int value="1" label="Known"/> <int value="1" label="Known"/>
</enum> </enum>
<enum name="BooleanLargeAllocationFromFreelist">
<int value="0" label="Allocated via IPC"/>
<int value="1" label="Allocated via Freelist"/>
</enum>
<enum name="BooleanLatched"> <enum name="BooleanLatched">
<int value="0" label="Not latched"/> <int value="0" label="Not latched"/>
<int value="1" label="Latched"/> <int value="1" label="Latched"/>
...@@ -398,6 +398,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -398,6 +398,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Memory.Discardable.LargeAllocationFromFreelist"
enum="BooleanLargeAllocationFromFreelist" expires_after="2021-03-07">
<owner>thiabaud@google.com</owner>
<owner>lizeb@chromium.org</owner>
<summary>
Boolean metric which tracks whether or not large chunks of discardable
memory are allocated from the freelist or via IPC.
</summary>
</histogram>
<histogram name="Memory.Discardable.LockingSuccess" <histogram name="Memory.Discardable.LockingSuccess"
enum="BooleanLockingSuccess" expires_after="2021-03-07"> enum="BooleanLockingSuccess" expires_after="2021-03-07">
<owner>thiabaud@google.com</owner> <owner>thiabaud@google.com</owner>
......
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