Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Issue 2697123007: base: Add support for malloc zones to the allocator shim (Closed)

Created:
3 years, 10 months ago by erikchen
Modified:
3 years, 10 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, mac-reviews_chromium.org, Dai Mikurube (NOT FULLTIME), vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

base: Add support for malloc zones to the allocator shim This CL has no functional change, but could cause performance regressions. It adds an additional void* context parameter to all allocator-shim related functions, as it will be necessary to support multiple malloc zones. BUG=693237 TBR=thakis@chromium.org Review-Url: https://codereview.chromium.org/2697123007 Cr-Commit-Position: refs/heads/master@{#451612} Committed: https://chromium.googlesource.com/chromium/src/+/eff0ecbf12a6757ebb46438100fef60dff531e43

Patch Set 1 #

Patch Set 2 : fix compile errors. #

Patch Set 3 : Windows compile error. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+325 lines, -180 lines) Patch
M base/allocator/allocator_shim.h View 1 chunk +20 lines, -9 lines 0 comments Download
M base/allocator/allocator_shim.cc View 5 chunks +46 lines, -26 lines 1 comment Download
M base/allocator/allocator_shim_default_dispatch_to_glibc.cc View 1 chunk +17 lines, -6 lines 0 comments Download
M base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc View 2 chunks +17 lines, -6 lines 0 comments Download
M base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.cc View 1 chunk +39 lines, -20 lines 0 comments Download
M base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc View 1 chunk +14 lines, -6 lines 0 comments Download
M base/allocator/allocator_shim_default_dispatch_to_winheap.cc View 2 chunks +15 lines, -7 lines 0 comments Download
M base/allocator/allocator_shim_override_glibc_weak_symbols.h View 1 1 chunk +4 lines, -4 lines 0 comments Download
M base/allocator/allocator_shim_override_mac_symbols.h View 1 chunk +12 lines, -10 lines 0 comments Download
M base/allocator/allocator_shim_override_ucrt_symbols_win.h View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M base/allocator/allocator_shim_unittest.cc View 2 chunks +32 lines, -18 lines 0 comments Download
M base/debug/thread_heap_usage_tracker.cc View 2 chunks +53 lines, -33 lines 0 comments Download
M base/debug/thread_heap_usage_tracker_unittest.cc View 7 chunks +22 lines, -13 lines 0 comments Download
M base/trace_event/malloc_dump_provider.cc View 3 chunks +30 lines, -18 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 34 (26 generated)
erikchen
primiano: Please review. If it looks good, please let this at a weird hour.
3 years, 10 months ago (2017-02-18 00:55:57 UTC) #13
erikchen
On 2017/02/18 00:55:57, erikchen wrote: > primiano: Please review. > > If it looks good, ...
3 years, 10 months ago (2017-02-18 00:56:10 UTC) #14
Primiano Tucci (use gerrit)
LGTM to get some this in the waterfall and get perf data, as Monday EMEA ...
3 years, 10 months ago (2017-02-20 10:33:05 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2697123007/40001
3 years, 10 months ago (2017-02-20 10:33:25 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/325321)
3 years, 10 months ago (2017-02-20 12:03:03 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2697123007/40001
3 years, 10 months ago (2017-02-20 12:37:28 UTC) #30
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/eff0ecbf12a6757ebb46438100fef60dff531e43
3 years, 10 months ago (2017-02-20 13:05:29 UTC) #33
erikchen
3 years, 10 months ago (2017-02-21 19:20:43 UTC) #34
Message was sent while issue was closed.
On 2017/02/20 10:33:05, Primiano Tucci wrote:
> LGTM to get some this in the waterfall and get perf data, as Monday EMEA
morning
> is most quiet period of the week ever.
> I would have preferred if the variable was explicitly called osx_zone or
> mac_zone instead of context. context IMHO creates a shade of mystery around
all
> this, as "context" can mean any random thing.
> anyhow, not a reason to delay this though, let's clean it up in a followup CL
if
> this sticks.
I intentionally named this "context" because there is a non-zero probability
that we will need something similar for Windows if we want to shim HeapAlloc.

> 
> Slightly unrelated, by reading the code, I just realized that we might reduce
> the calls to malloc_default_zone() right now we call it on each allocation,
> while we could probably cache the zone ptr in the g_default_zone (which today
> stores only the function pointers). Let's discuss this separately.
> 
> Also I took the liberty to:
> - rewrite the 1st line of the commit message, the previous one didn't clarify
> that it was touching the allocator
> - wrap the rest of the commit message @ 72 cols.
> - TBR thakis@ for the remaining changes in debug/thread_heap_usage_tracker.cc
> which are outside of my OWNERS powerz and are just mechanically adding another
> argument. (sorry for the rush Nico, but I really want this CL to go in the
perf
> waterfall as much isolated as possible from the rest to see if regresses any
> other platform)
> 
>
https://codereview.chromium.org/2697123007/diff/40001/base/allocator/allocato...
> File base/allocator/allocator_shim.cc (right):
> 
>
https://codereview.chromium.org/2697123007/diff/40001/base/allocator/allocato...
> base/allocator/allocator_shim.cc:250: return ShimMemalign(GetCachedPageSize(),
> size, nullptr);
> add a comment saying that this is nullptr because pvalloc is glibc only and
does
> not exist on OSX/BSD systems

Powered by Google App Engine
This is Rietveld 408576698