Navigation Menu

Skip to content

Commit

Permalink
8240217: Shenandoah: remove ShenandoahEvacAssist
Browse files Browse the repository at this point in the history
Reviewed-by: rkennke
  • Loading branch information
shipilev committed Feb 28, 2020
1 parent 6ad1db4 commit 8a79f26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
39 changes: 2 additions & 37 deletions src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
Expand Up @@ -144,43 +144,8 @@ oop ShenandoahBarrierSet::load_reference_barrier_mutator_work(oop obj, T* load_a
if (obj == fwd) {
assert(_heap->is_gc_in_progress_mask(ShenandoahHeap::EVACUATION | ShenandoahHeap::TRAVERSAL),
"evac should be in progress");

ShenandoahEvacOOMScope oom_evac_scope;

Thread* thread = Thread::current();
oop res_oop = _heap->evacuate_object(obj, thread);

// Since we are already here and paid the price of getting through runtime call adapters
// and acquiring oom-scope, it makes sense to try and evacuate more adjacent objects,
// thus amortizing the overhead. For sparsely live heaps, scan costs easily dominate
// total assist costs, and can introduce a lot of evacuation latency. This is why we
// only scan for _nearest_ N objects, regardless if they are eligible for evac or not.
// The scan itself should also avoid touching the non-marked objects below TAMS, because
// their metadata (notably, klasses) may be incorrect already.

size_t max = ShenandoahEvacAssist;
if (max > 0) {
// Traversal is special: it uses incomplete marking context, because it coalesces evac with mark.
// Other code uses complete marking context, because evac happens after the mark.
ShenandoahMarkingContext* ctx = _heap->is_concurrent_traversal_in_progress() ?
_heap->marking_context() : _heap->complete_marking_context();

ShenandoahHeapRegion* r = _heap->heap_region_containing(obj);
assert(r->is_cset(), "sanity");

HeapWord* cur = cast_from_oop<HeapWord*>(obj) + obj->size();

size_t count = 0;
while ((cur < r->top()) && ctx->is_marked(oop(cur)) && (count++ < max)) {
oop cur_oop = oop(cur);
if (cur_oop == resolve_forwarded_not_null_mutator(cur_oop)) {
_heap->evacuate_object(cur_oop, thread);
}
cur = cur + cur_oop->size();
}
}

fwd = res_oop;
ShenandoahEvacOOMScope scope;
fwd = _heap->evacuate_object(obj, Thread::current());
}

if (load_addr != NULL && fwd != obj) {
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp
Expand Up @@ -235,10 +235,6 @@
"evacuation reserve/waste is incorrect, at the risk that " \
"application allocations run out of memory too early.") \
\
experimental(uintx, ShenandoahEvacAssist, 10, \
"How many objects to evacuate on LRB assist path. " \
"Use zero to disable.") \
\
experimental(bool, ShenandoahPacing, true, \
"Pace application allocations to give GC chance to start " \
"and complete before allocation failure is reached.") \
Expand Down

0 comments on commit 8a79f26

Please sign in to comment.