Reduce pinned object table size, part 2 of 2.
commit554a9fc17a38a0220cd968183998248e0ac4ab5e
authorDouglas Katzman <dougk@google.com>
Mon, 3 Apr 2017 03:12:46 +0000 (2 23:12 -0400)
committerDouglas Katzman <dougk@google.com>
Mon, 3 Apr 2017 03:59:04 +0000 (2 23:59 -0400)
treeb73a0cc0d94d513bfcbb2a4863ae4126f10e24f5
parent8333dce45f777ae33385cfe3269dcb31fcc83d20
Reduce pinned object table size, part 2 of 2.

Replace bitmap with a hashtable, eliminating 1-bit-per-cons overhead.
At worst the hashtable tends to get a few hundred objects in it,
but nothing near the space that the bitmap consumed, which was 1 bit
per 64 bits, or 1 bit per 128 bits on 32-bit or 64-bit respectively.

It was exceedingly difficult to discern whether this strictly decreases
running time in all cases, but it does appear to be much friendlier to
the OS. On a fairly idle machine with ample memory, there was no major
performance difference between the bitmap and this, because neither way
causes enough page faults to produce a measurable signal.

However, on a busy system, the smaller address space footprint is a clear
improvement, impacting the all-inclusive user+system time by at least
a half percent on x86-64, and nearly a percent for 32-bit,
where the relative decrease in memory requirement is more significant.

The efficiency isn't attributable to less GC time, but elsewhere,
which is both surprising and not - not, because a hashtable executes many
more instructions versus a few shifts and read to test a bit in a bitmap.
But while the system time decreased, the total user time seemed to increase
by a lesser amount. This is inexplicable other than to say that my test had
to run for at least half a day before there was any kind of stable delta
at all, so the user time change was quite likely measurement noise.
src/runtime/gc-common.c
src/runtime/gc-internal.h
src/runtime/gencgc-internal.h
src/runtime/gencgc.c