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

Issue 7430007: Merge tcmalloc r111 (perftools v. 1.8) with the chromium/ branch.

Created:
9 years, 5 months ago by Alexander Potapenko
Modified:
9 years, 4 months ago
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, Paweł Hajdan Jr., willchan no longer on Chromium
Visibility:
Public.

Description

Merge tcmalloc r111 (perftools v. 1.8) with the chromium/ branch.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+1306 lines, -1207 lines) Patch
M base/allocator/allocator.gyp View 1 2 3 4 5 6 7 8 7 chunks +21 lines, -0 lines 0 comments Download
M third_party/tcmalloc/README.chromium View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/tcmalloc/chromium/src/base/atomicops-internals-windows.h View 1 2 3 4 5 6 7 8 7 chunks +107 lines, -20 lines 0 comments Download
M third_party/tcmalloc/chromium/src/base/cycleclock.h View 1 2 3 4 5 6 7 8 2 chunks +13 lines, -5 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/base/elf_mem_image.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/base/elf_mem_image.cc View 0 chunks +-1 lines, --1 lines 0 comments Download
M third_party/tcmalloc/chromium/src/base/low_level_alloc.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/tcmalloc/chromium/src/base/spinlock_internal.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 1 comment Download
M third_party/tcmalloc/chromium/src/base/vdso_support.h View 1 2 3 4 5 6 7 8 5 chunks +39 lines, -70 lines 0 comments Download
M third_party/tcmalloc/chromium/src/base/vdso_support.cc View 1 2 3 4 5 6 7 8 6 chunks +9 lines, -383 lines 0 comments Download
M third_party/tcmalloc/chromium/src/central_freelist.h View 1 2 3 4 5 6 7 8 4 chunks +22 lines, -11 lines 1 comment Download
M third_party/tcmalloc/chromium/src/central_freelist.cc View 1 2 3 4 5 6 7 8 7 chunks +41 lines, -5 lines 0 comments Download
M third_party/tcmalloc/chromium/src/common.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -7 lines 3 comments Download
M third_party/tcmalloc/chromium/src/common.cc View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -15 lines 1 comment Download
M third_party/tcmalloc/chromium/src/config.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -5 lines 0 comments Download
M third_party/tcmalloc/chromium/src/config.h.in View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/config_freebsd.h View 1 2 3 4 5 6 7 8 2 chunks +11 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/config_linux.h View 1 2 3 4 5 6 7 8 2 chunks +11 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/config_win.h View 1 2 3 4 5 6 7 8 2 chunks +11 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/debugallocation.cc View 1 2 3 4 5 6 7 8 4 chunks +20 lines, -31 lines 0 comments Download
M third_party/tcmalloc/chromium/src/google/heap-checker.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -2 lines 0 comments Download
M third_party/tcmalloc/chromium/src/google/malloc_extension.h View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -3 lines 0 comments Download
M third_party/tcmalloc/chromium/src/google/malloc_extension_c.h View 1 2 3 4 5 6 7 8 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/google/malloc_hook.h View 1 2 3 4 5 6 7 8 2 chunks +13 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/google/tcmalloc.h View 1 2 3 4 5 6 7 8 1 chunk +111 lines, -56 lines 0 comments Download
M third_party/tcmalloc/chromium/src/heap-checker.cc View 1 2 3 4 5 6 7 8 5 chunks +4 lines, -6 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/libc_override.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -0 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/libc_override_gcc_and_weak.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/libc_override_glibc.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/libc_override_osx.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/libc_override_redefine.h View 0 chunks +-1 lines, --1 lines 0 comments Download
M third_party/tcmalloc/chromium/src/linux_shadow_stacks.cc View 0 chunks +-1 lines, --1 lines 0 comments Download
M third_party/tcmalloc/chromium/src/malloc_extension.cc View 1 2 3 4 5 6 7 8 4 chunks +18 lines, -5 lines 0 comments Download
M third_party/tcmalloc/chromium/src/malloc_hook.cc View 1 2 3 4 5 6 7 8 5 chunks +15 lines, -188 lines 0 comments Download
M third_party/tcmalloc/chromium/src/malloc_hook-inl.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
A + third_party/tcmalloc/chromium/src/malloc_hook_mmap_freebsd.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h View 0 chunks +-1 lines, --1 lines 0 comments Download
MM third_party/tcmalloc/chromium/src/maybe_threads.cc View 1 2 3 4 5 6 7 8 2 chunks +20 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/memfs_malloc.cc View 1 2 3 4 5 6 7 8 4 chunks +44 lines, -41 lines 0 comments Download
M third_party/tcmalloc/chromium/src/memory_region_map.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/tcmalloc/chromium/src/pprof View 1 2 3 4 5 6 7 8 26 chunks +353 lines, -52 lines 0 comments Download
MM third_party/tcmalloc/chromium/src/profile-handler.cc View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -3 lines 0 comments Download
M third_party/tcmalloc/chromium/src/profiler.cc View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -3 lines 0 comments Download
M third_party/tcmalloc/chromium/src/stacktrace.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -5 lines 0 comments Download
M third_party/tcmalloc/chromium/src/stacktrace_config.h View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -2 lines 0 comments Download
A + third_party/tcmalloc/chromium/src/stacktrace_nacl-inl.h View 0 chunks +-1 lines, --1 lines 0 comments Download
M third_party/tcmalloc/chromium/src/symbolize.cc View 1 2 3 4 5 6 7 8 5 chunks +39 lines, -4 lines 0 comments Download
M third_party/tcmalloc/chromium/src/system-alloc.cc View 1 2 3 4 5 6 7 8 5 chunks +2 lines, -4 lines 0 comments Download
M third_party/tcmalloc/chromium/src/tcmalloc.cc View 1 2 3 4 5 6 7 8 12 chunks +46 lines, -198 lines 0 comments Download
M third_party/tcmalloc/chromium/src/tests/debugallocation_test.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -1 line 0 comments Download
M third_party/tcmalloc/chromium/src/tests/malloc_extension_c_test.c View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/tests/malloc_extension_test.cc View 1 2 3 4 5 6 7 8 2 chunks +20 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/tests/malloc_hook_test.cc View 1 2 3 4 5 6 7 8 7 chunks +28 lines, -7 lines 0 comments Download
M third_party/tcmalloc/chromium/src/tests/profiler_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/tcmalloc/chromium/src/tests/system-alloc_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -4 lines 0 comments Download
M third_party/tcmalloc/chromium/src/tests/tcmalloc_unittest.cc View 1 2 3 4 5 6 7 8 6 chunks +83 lines, -47 lines 0 comments Download
M third_party/tcmalloc/chromium/src/thread_cache.cc View 1 2 3 4 5 6 7 8 5 chunks +37 lines, -14 lines 0 comments Download
M third_party/tcmalloc/chromium/src/windows/config.h View 1 2 3 4 5 6 7 8 6 chunks +20 lines, -2 lines 0 comments Download
M third_party/tcmalloc/chromium/src/windows/google/tcmalloc.h.in View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -1 line 0 comments Download
M third_party/tcmalloc/chromium/src/windows/mingw.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/tcmalloc/chromium/src/windows/port.h View 1 2 3 4 5 6 7 8 4 chunks +7 lines, -3 lines 0 comments Download
M third_party/tcmalloc/chromium/src/windows/port.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Alexander Potapenko
Will, here's the merge containing the Mac OS bits. Please pay specific attention to the ...
9 years, 4 months ago (2011-07-28 14:19:19 UTC) #1
willchan no longer on Chromium
I'm switching Jim to be the primary reviewer here. Jim, let me know if you ...
9 years, 4 months ago (2011-07-29 08:33:39 UTC) #2
jar (doing other things)
9 years, 4 months ago (2011-07-31 08:19:39 UTC) #3
A lot of this appears to relate to a recent suggestion about tuning TCMalloc, as
mentioned on a recent thread.  Have those tunings become main-stream (the paper
seemed to list them tentatively... but maybe the paper is outdated??).

I probably need to look even more closely at this, but I wanted to give some
feedback.

I'd be very interested in hearing if this CL had an immediate impact (fearing
the worst) on the perf-bots for Chrome.  Have you tried to land and revert this
patch set during an evening to see what the impact is? (Please try to land a
only a related CL, using the diff file, so that we don't lose our comment
history on this CL).

It would be much nicer if these new tunings were better controlled by #ifdefs,
the way LARGE_PAGE use is.

I strongly suspect some of these tunings are better suited to server utilization
of TCMalloc... and I'd like to talk through the impact a bit more before landing
it.

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
File third_party/tcmalloc/chromium/src/base/spinlock_internal.cc (right):

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
third_party/tcmalloc/chromium/src/base/spinlock_internal.cc:47: #elif
defined(__linux__) && !defined(__native_client__)
I was expecting items provided by more mainstream TCMalloc.  This looks like a
Chromium specific change.  

Was this added because we couldn't compile new stuff without this change?

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
File third_party/tcmalloc/chromium/src/central_freelist.h (right):

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
third_party/tcmalloc/chromium/src/central_freelist.h:74: // page full of 5-byte
objects would have 2 bytes memory overhead).
This commment is confusing... but perhaps you're just porting a questionable
comment?

The example makes it sound like this is fragmentation due to left over bytes
during span carving.  The description says this has to do with freelists, which
seem very orthogonal.

Is this just a comment you merged into place?

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
File third_party/tcmalloc/chromium/src/common.cc (right):

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
third_party/tcmalloc/chromium/src/common.cc:125: // Continue to add pages until
there are at least as many objects in
I'm not clear on the justification for doing this.
Yes, it will help when we do the *first* allocation (and we had nothing). 
However, when we have some left-over in the central cache, but not enough to
satisfy a request from a thread, this will seemingly lead to over-allocation (so
as to avoid a second call??).  I'd like to better understand the motivation.

<sigh>... but glancing at the code in line 116, perhaps this is actually 1/4th
of the amount we typically move... which would be sensible.  I need to look at
the definition and use of NumMoveSize().

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
File third_party/tcmalloc/chromium/src/common.h (right):

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
third_party/tcmalloc/chromium/src/common.h:68: static const size_t kPageShift  =
13;
This is the change to 8K pages from 4K.  The recent paper suggests this works
well for servers, but we really need to tune this for Chrome (or at least watch
that we don't see a regression when we land this).

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
third_party/tcmalloc/chromium/src/common.h:71: static const size_t
kMaxThreadCacheSize = 4 << 20;
This looks like another change (for us, since we don't use LARGE_PAGES).  I
don't recall seeing a justification for this tuning change.

http://codereview.chromium.org/7430007/diff/18014/third_party/tcmalloc/chromi...
third_party/tcmalloc/chromium/src/common.h:74: static const size_t kMaxSize    =
256 * 1024;
This is a big tuning change, upping the cutoff point to 256K from 32K.
Although we allocate IO buffers of 32K size, I don't think we do much larger
allocating.  Also, the 32K allocations will now be carved, and might not be
coalesced to spans and returned to the OS... which would notably raise our
committed memory footprint.

This tuning change is especially unclear for us on Chrome (unless I'm
mis-remembering the algorithms and mis-guessing the impact)

Powered by Google App Engine
This is Rietveld 408576698