Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(208)

Issue 83630044: code review 83630044: cmd/gc, cmd/ld, runtime: compact liveness bitmaps (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by rsc
Modified:
12 years, 6 months ago
Reviewers:
gobot, khr
CC:
golang-codereviews
Visibility:
Public.

Description

cmd/gc, cmd/ld, runtime: compact liveness bitmaps Reduce footprint of liveness bitmaps by about 5x. 1. Mark all liveness bitmap symbols as 4-byte aligned (they were aligned to a larger size by default). 2. The bitmap data is a bitmap count n followed by n bitmaps. Each bitmap begins with its own count m giving the number of bits. All the m's are the same for the n bitmaps. Emit this bitmap length once instead of n times. 3. Many bitmaps within a function have the same bit values, but each call site was given a distinct bitmap. Merge duplicate bitmaps so that no bitmap is written more than once. 4. Many functions end up with the same aggregate bitmap data. We used to name the bitmap data funcname.gcargs and funcname.gclocals. Instead, name it gclocals.<md5 of data> and mark it dupok so that the linker coalesces duplicate sets. This cut the bitmap data remaining after step 3 by 40%; I was not expecting it to be quite so dramatic. Applied to "go build -ldflags -w code.google.com/p/go.tools/cmd/godoc": bitmaps pclntab binary on disk before this CL 1326600 1985854 12738268 4-byte align 1154288 (0.87x) 1985854 (1.00x) 12566236 (0.99x) one bitmap len 782528 (0.54x) 1985854 (1.00x) 12193500 (0.96x) dedup bitmap 414748 (0.31x) 1948478 (0.98x) 11787996 (0.93x) dedup bitmap set 245580 (0.19x) 1948478 (0.98x) 11620060 (0.91x) While here, remove various dead blocks of code from plive.c. Fixes issue 6929. Fixes issue 7568.

Patch Set 1 #

Patch Set 2 : diff -r c1903a893ed7 https://code.google.com/p/go/ #

Patch Set 3 : diff -r c1903a893ed7 https://code.google.com/p/go/ #

Patch Set 4 : diff -r c1903a893ed7 https://code.google.com/p/go/ #

Patch Set 5 : diff -r c1903a893ed7 https://code.google.com/p/go/ #

Patch Set 6 : diff -r c1903a893ed7 https://code.google.com/p/go/ #

Patch Set 7 : diff -r 423f84bbb31e https://code.google.com/p/go/ #

Total comments: 1

Patch Set 8 : diff -r 98fa19f0c380 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -181 lines) Patch
M src/cmd/gc/go.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gc/md5.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gc/md5.c View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M src/cmd/gc/pgen.c View 1 2 3 4 5 5 chunks +21 lines, -11 lines 0 comments Download
M src/cmd/gc/plive.c View 1 2 3 14 chunks +130 lines, -125 lines 0 comments Download
M src/cmd/gc/subr.c View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/ld/lib.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/ld/pobj.c View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/ld/symtab.c View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/liblink/objfile.c View 1 2 3 4 5 6 7 3 chunks +12 lines, -2 lines 0 comments Download
M src/pkg/runtime/heapdump.c View 1 7 chunks +11 lines, -11 lines 0 comments Download
M src/pkg/runtime/malloc.h View 1 2 3 4 5 6 7 3 chunks +5 lines, -4 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 4 chunks +7 lines, -19 lines 0 comments Download
M src/pkg/runtime/stack.c View 1 5 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 9
rsc
Hello khr (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
12 years, 6 months ago (2014-04-02 17:31:53 UTC) #1
rsc
I added code to this CL to dedup the eventual bitmap sets as well, by ...
12 years, 6 months ago (2014-04-02 17:56:49 UTC) #2
khr
LGTM. That's a pretty good space savings. What happens on an md5 collision? https://codereview.appspot.com/83630044/diff/110001/src/cmd/gc/pgen.c File ...
12 years, 6 months ago (2014-04-02 20:17:49 UTC) #3
rsc
On Wed, Apr 2, 2014 at 4:17 PM, <khr@golang.org> wrote: > LGTM. That's a pretty ...
12 years, 6 months ago (2014-04-02 20:19:25 UTC) #4
khr
On 2014/04/02 20:19:25, rsc wrote: > On Wed, Apr 2, 2014 at 4:17 PM, <mailto:khr@golang.org> ...
12 years, 6 months ago (2014-04-02 20:24:09 UTC) #5
rsc
On Wed, Apr 2, 2014 at 4:24 PM, <khr@golang.org> wrote: > On 2014/04/02 20:19:25, rsc ...
12 years, 6 months ago (2014-04-02 20:49:03 UTC) #6
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=5052ec3ce1c1 *** cmd/gc, cmd/ld, runtime: compact liveness bitmaps Reduce footprint of liveness ...
12 years, 6 months ago (2014-04-02 20:49:37 UTC) #7
gobot
This CL appears to have broken the linux-386 builder. See http://build.golang.org/log/d5875279232ed71c5ca79d6c584fc5c1b07695b8
12 years, 6 months ago (2014-04-02 20:53:10 UTC) #8
khr
12 years, 6 months ago (2014-04-02 20:56:24 UTC) #9
Message was sent while issue was closed.
On 2014/04/02 20:53:10, gobot wrote:
> This CL appears to have broken the linux-386 builder.
> See http://build.golang.org/log/d5875279232ed71c5ca79d6c584fc5c1b07695b8

Nothing in particular about MD5, collisions in general.
Your liblink detection looks good.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b