8152438: Threads may do significant work out of the non-shared overflow buffer

Before processing an element in the non-shared overflow buffer, try to push it into the local shared buffer to keep it full.

Reviewed-by: jmasa, ehelin, sjohanss
This commit is contained in:
Thomas Schatzl 2016-06-22 10:34:01 +02:00
parent 161976b05f
commit 423717c156
3 changed files with 11 additions and 2 deletions

View file

@ -137,7 +137,9 @@ void G1ParScanThreadState::trim_queue() {
do {
// Drain the overflow stack first, so other threads can steal.
while (_refs->pop_overflow(ref)) {
dispatch_reference(ref);
if (!_refs->try_push_to_taskqueue(ref)) {
dispatch_reference(ref);
}
}
while (_refs->pop_local(ref)) {