[master] RFR: 8304710: [Lilliput] Use forwarding table for sliding GCs [v4]
Roman Kennke
rkennke at openjdk.org
Fri Apr 14 10:59:10 UTC 2023
> This changes the full-GC forwarding of Serial, Parallel, G1 and Shenandoah to use a forwarding table instead of the fancy SlidingForwarding that we had until now. SlidingForwarding has been problematic because it did not work universally, in particular we needed to disable the G1 serial full GC (the last last ditch GC, after parallel full GC failed). Also, sliding forwarding would not work when we start working towards 32bit headers.
>
> The implementation of the forwarding table is a dense array of forwardings, with sorted entries and binary search. For details, have a look at the comments at the top of class ForwardingTable.
>
> The change also greatly reduces the upstream diff.
>
> In G1 I added a little code to count the marked objects in each region by counting bits in the mark-bitmap.
>
> In Serial GC I likewise added some code to count new vs old objects during full-GC marking. Here there would be the alternative to treat the heap as a single region, and count marked objects without distinguishing old vs young. The problem is that old is allocated in higher memory than young, and the full-GC compacts old-gen first, and then young-gen, which breaks the assumption in ForwardingTable, which leads to very slow forwarding insertions. I also tried to simply swap the old and young reserved memory, and that is possible, but triggers all sorts of related changes where the memory order is implicitely used for stuff like is_in_young() etc.
>
> Testing:
> - [x] tier1
> - [x] tier2
Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
Aleksey's review
-------------
Changes:
- all: https://git.openjdk.org/lilliput/pull/83/files
- new: https://git.openjdk.org/lilliput/pull/83/files/40d889bc..74d6483a
Webrevs:
- full: https://webrevs.openjdk.org/?repo=lilliput&pr=83&range=03
- incr: https://webrevs.openjdk.org/?repo=lilliput&pr=83&range=02-03
Stats: 33 lines in 10 files changed: 15 ins; 6 del; 12 mod
Patch: https://git.openjdk.org/lilliput/pull/83.diff
Fetch: git fetch https://git.openjdk.org/lilliput.git pull/83/head:pull/83
PR: https://git.openjdk.org/lilliput/pull/83
More information about the lilliput-dev
mailing list