Cache the size of part_list/scavd_list (#11783)
authorSimon Marlow <marlowsd@gmail.com>
Tue, 12 Apr 2016 02:29:14 +0000 (19:29 -0700)
committerBen Gamari <ben@smart-cactus.org>
Mon, 16 May 2016 18:36:40 +0000 (20:36 +0200)
commit9649973c8038591a2c9f77e1183dd920b724daa5
treed9a2b35ba010fe5e3745b0d9b2c25229f2506f58
parentb105b0a09dd5aaf663b661fade7c01e6a2670519
Cache the size of part_list/scavd_list (#11783)

After a parallel GC, it is possible to have a long list of blocks in
ws->part_list, if we did a lot of work stealing but didn't fill up the
blocks we stole.  These blocks persist until the next load-balanced GC,
which might be a long time, and during every GC we were traversing this
list to find its size.  The fix is to maintain the size all the time, so
we don't have to compute it.

(cherry picked from commit 5c4cd0e44657d52f7ca5fee63f8765d17f1fbe85)
rts/sm/GC.c
rts/sm/GCThread.h
rts/sm/GCUtils.c
rts/sm/Storage.c