Attention is currently required from: Kentaro Hara.
Benoit L would like Kentaro Hara to review this change.
[PartitionAlloc] Dynamically adjust thread cache limits.
The thread cache keeps a number of deallocated objects, hoping to
service other allocations with it. This creates a compromise between
memory and performance.
This CL adds dynamic tuning of the thread cache limits. It can be set
process-wide, which will be used in subsequent CLs to adjust it
depending on the platform and/or process state
(e.g. foreground/background),
Bug: 998048, 1169159, 1169157
Change-Id: Ie7003fecd362ca613ea32d2242dbe811ea94246f
---
M base/allocator/partition_allocator/thread_cache.cc
M base/allocator/partition_allocator/thread_cache.h
M base/allocator/partition_allocator/thread_cache_unittest.cc
3 files changed, 231 insertions(+), 33 deletions(-)
To view, visit change 2727815. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Kentaro Hara.
Attention is currently required from: Benoit L.
Patch set 2:Code-Review +1
4 comments:
Patchset:
I personally don't see a lot of benefits in making the threshold dynamically configurable but CrOS people might want it. LGTM.
File base/allocator/partition_allocator/thread_cache.h:
Patch Set #2, Line 328: // value, just want to it not change while we are using it, hence using
want it to not
File base/allocator/partition_allocator/thread_cache.cc:
Patch Set #2, Line 183: // we really wnt to avoid atomic instruction on the fast path.
want
Patch Set #2, Line 311: value = initial_value / 4;
Nit: I'm even fine with setting value to 0 for 512+ KB slots though. It costs a lot...
To view, visit change 2727815. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Kentaro Hara.
CQ is trying the patch.
Note: The patchset #3 "Typo" sent to CQ was uploaded after this CL was CR+1-ed.
Reviewer, please verify there is nothing unexpected https://chromium-review.googlesource.com/c/2727815/3
Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/chromium-review.googlesource.com/2727815/3
Bot data: {"action": "start", "triggered_at": "2021-03-02T12:43:25.0Z", "revision": "48f672e6241d54d2e6ce612e529fd9aa1bb9c6dd"}
Attention is currently required from: Kentaro Hara.
Patch set 3:Commit-Queue +2
4 comments:
Patchset:
Thanks!
File base/allocator/partition_allocator/thread_cache.h:
Patch Set #2, Line 328: // value, just want to it not change while we are using it, hence using
want it to not
Done
File base/allocator/partition_allocator/thread_cache.cc:
Patch Set #2, Line 183: // we really wnt to avoid atomic instruction on the fast path.
want
Done
Patch Set #2, Line 311: value = initial_value / 4;
Nit: I'm even fine with setting value to 0 for 512+ KB slots though. It costs a lot...
It is 0 for allocations larger than 512 bytes, not kiB (ThreadCache::kSizeThreshold). One goal here is also to increase the current 512 bytes limit to a larger one, but only for foreground tabs for instance.
But this would be in another CL, since it requires more changes.
To view, visit change 2727815. To unsubscribe, or for help writing mail filters, visit settings.
Chromium LUCI CQ submitted this change.
[PartitionAlloc] Dynamically adjust thread cache limits.
The thread cache keeps a number of deallocated objects, hoping to
service other allocations with it. This creates a compromise between
memory and performance.
This CL adds dynamic tuning of the thread cache limits. It can be set
process-wide, which will be used in subsequent CLs to adjust it
depending on the platform and/or process state
(e.g. foreground/background),
Bug: 998048, 1169159, 1169157
Change-Id: Ie7003fecd362ca613ea32d2242dbe811ea94246f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2727815
Commit-Queue: Benoit L <li...@chromium.org>
Reviewed-by: Kentaro Hara <har...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#858966}
---
M base/allocator/partition_allocator/thread_cache.cc
M base/allocator/partition_allocator/thread_cache.h
M base/allocator/partition_allocator/thread_cache_unittest.cc
3 files changed, 231 insertions(+), 33 deletions(-)
To view, visit change 2727815. To unsubscribe, or for help writing mail filters, visit settings.