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

Issue 1578163002: Enable tcmalloc VDSO support only on x86 to reduce static initializers (Closed)

Created:
4 years, 11 months ago by Primiano Tucci (use gerrit)
Modified:
4 years, 11 months ago
CC:
chromium-reviews, wfh+watch_chromium.org, Dai Mikurube (NOT FULLTIME), vmpstr+watch_chromium.org, brettw, Lei Zhang
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Enable tcmalloc VDSO support only on x86 to reduce static initializers Background context ------------------ crrev.com/1466173002 switched the GN tcmalloc target from source_set -> static_library. There are good reasons for keeping tcmalloc a source_set (see "Note on static libraries" in [1]). However, in the current state source_set was exposing extra static initializers in the GN build which, are not present in the gyp build due to the linker gc sections. Resolution of this CL --------------------- The fact that vdso_support.cc is GC-ed by the linker is the symptom that such code is unreachable. A search in the codebase shows that the only client is stacktrace_x86-inl.h, which depends on VDSO only when defined(__linux__) && defined(__i386__) This CL is therefore matching this condition in vdso_support.h and conditioning the #define HAVE_VDSO_SUPPORT with the same conditions. Final result after this CL -------------------------- On GYP, the chrome binary is bit-identical before and after this CL: $ md5sum out_gyp/Release/chrome{,.tot} 0e9205350b9604eb7fc16988e39a7a86 out_gyp/Release/chrome 0e9205350b9604eb7fc16988e39a7a86 out_gyp/Release/chrome.tot This CL does not regress GN static initializers (w.r.t. gyp) either: $ tools/linux/dump-static-initializers.py out_gn/chrome ... (verbose output omitted) ... Found 38 static initializers in 7 files. $ tools/linux/dump-static-initializers.py out_gyp/Release/chrome ... (verbose output omitted) ... Found 38 static initializers in 7 files. [1] https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/cookbook.md BUG=559766, 564618 Committed: https://crrev.com/a51d32cb536525bc8f6ca372da94bc719eed55f7 Cr-Commit-Position: refs/heads/master@{#368940}

Patch Set 1 #

Patch Set 2 : better approach #

Patch Set 3 : Ghh, comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -5 lines) Patch
M base/allocator/BUILD.gn View 2 chunks +2 lines, -5 lines 0 comments Download
M third_party/tcmalloc/README.chromium View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/base/vdso_support.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (8 generated)
Primiano Tucci (use gerrit)
+dpranke/wfh: It's just a 4 line change in the .h and I think this is ...
4 years, 11 months ago (2016-01-12 13:37:33 UTC) #3
Will Harris
On 2016/01/12 13:37:33, Primiano Tucci wrote: > +dpranke/wfh: It's just a 4 line change in ...
4 years, 11 months ago (2016-01-12 13:44:14 UTC) #4
Primiano Tucci (use gerrit)
+thakis for a 1 line change in base/allocator/BUILD.gn
4 years, 11 months ago (2016-01-12 13:55:55 UTC) #6
Nico
Actually, now that I look at the other files: Do we need the vdso stuff ...
4 years, 11 months ago (2016-01-12 15:25:29 UTC) #7
Primiano Tucci (use gerrit)
happy to undef HAVE_VDSO_SUPPORT completely if wfh agreed. I was trying to make the change ...
4 years, 11 months ago (2016-01-12 15:51:54 UTC) #8
Will Harris
On 2016/01/12 15:51:54, Primiano Tucci wrote: > happy to undef HAVE_VDSO_SUPPORT completely if wfh agreed. ...
4 years, 11 months ago (2016-01-12 15:55:23 UTC) #10
Primiano Tucci (use gerrit)
On 2016/01/12 15:55:23, Will Harris (in DC) wrote: > I was happy that this CL ...
4 years, 11 months ago (2016-01-12 16:14:05 UTC) #11
Will Harris
On 2016/01/12 16:14:05, Primiano Tucci wrote: > On 2016/01/12 15:55:23, Will Harris (in DC) wrote: ...
4 years, 11 months ago (2016-01-12 16:20:29 UTC) #12
Nico
ok On Tue, Jan 12, 2016 at 11:20 AM, <wfh@chromium.org> wrote: > On 2016/01/12 16:14:05, ...
4 years, 11 months ago (2016-01-12 16:20:57 UTC) #13
Primiano Tucci (use gerrit)
Filed crbug.com/576786 to track the vDSO full cleanup.
4 years, 11 months ago (2016-01-12 17:00:03 UTC) #14
brettw
lgtm
4 years, 11 months ago (2016-01-12 18:55:14 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1578163002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1578163002/40001
4 years, 11 months ago (2016-01-12 19:09:37 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 11 months ago (2016-01-12 19:16:59 UTC) #20
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/a51d32cb536525bc8f6ca372da94bc719eed55f7 Cr-Commit-Position: refs/heads/master@{#368940}
4 years, 11 months ago (2016-01-12 19:18:26 UTC) #22
Dirk Pranke
4 years, 11 months ago (2016-01-26 02:04:51 UTC) #23
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698