RFR: Locked allocation
Roman Kennke
rkennke at redhat.com
Wed Dec 14 16:36:29 UTC 2016
This patch throws out all the lockfree allocation madness, and
implements a much simpler locked allocation. Since we can't easily use
Mutex and friends, and also don't need most of their functionality
(wait/notify, nesting, etc), I implemented a very simple (simple as in,
can read-and-understand it in one glance) CAS based spin-lock. This is
wrapped around the normal allocation path, the humongous allocation
path and the heap growing path. It is not locking around the call to
full-gc, as this involves other locks and as CHF says, there are
alligators there ;-)
This does immensely simplify ShenandoahFreeSet, especially the racy
humongous allocation path. It does fix the bug that some people have
encountered about used not consistent with capacity.
I've tested it using gc-bench (no regression in allocation throughput),
SPECjvm and jtreg tests. Looks all fine.
When reviewing, please pay special attention to the lock in
ShenandoahHeap::allocate_memory()!
http://cr.openjdk.java.net/~rkennke/lockedalloc/webrev.00/
Ok?
Roman
More information about the shenandoah-dev
mailing list