< prev index next >
src/share/vm/gc_implementation/shenandoah/shenandoahControlThread.hpp
Print this page
rev 10690 : [backport] Cleanup header files and forward declarations
rev 10740 : [backport] Protect more internal code from false sharing
rev 10748 : [backport] Handle metadata induced GC
rev 10756 : [backport] Factor out implicit/explicit GC requests
rev 10772 : [backport] Update copyrights
*** 1,7 ****
/*
! * Copyright (c) 2013, 2015, Red Hat, Inc. and/or its affiliates.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
--- 1,7 ----
/*
! * Copyright (c) 2013, 2018, Red Hat, Inc. All rights reserved.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
*** 22,37 ****
*/
#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTTHREAD_HPP
#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTTHREAD_HPP
#include "gc_implementation/shared/concurrentGCThread.hpp"
#include "gc_implementation/shenandoah/shenandoahHeap.hpp"
#include "gc_implementation/shenandoah/shenandoahSharedVariables.hpp"
- #include "gc_interface/gcCause.hpp"
- #include "memory/resourceArea.hpp"
#include "runtime/task.hpp"
class ShenandoahControlThread;
// Periodic task is useful for doing asynchronous things that do not require (heap) locks,
// or synchronization with other parts of collector. These could run even when ShenandoahConcurrentThread
--- 22,37 ----
*/
#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTTHREAD_HPP
#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTTHREAD_HPP
+ #include "gc_interface/gcCause.hpp"
#include "gc_implementation/shared/concurrentGCThread.hpp"
#include "gc_implementation/shenandoah/shenandoahHeap.hpp"
#include "gc_implementation/shenandoah/shenandoahSharedVariables.hpp"
#include "runtime/task.hpp"
+ #include "utilities/ostream.hpp"
class ShenandoahControlThread;
// Periodic task is useful for doing asynchronous things that do not require (heap) locks,
// or synchronization with other parts of collector. These could run even when ShenandoahConcurrentThread
*** 62,75 ****
stw_degenerated,
stw_full,
} GCMode;
// While we could have a single lock for these, it may risk unblocking
! // explicit GC waiters when alloc failure GC cycle finishes. We want instead
// to make complete explicit cycle for for demanding customers.
Monitor _alloc_failure_waiters_lock;
! Monitor _explicit_gc_waiters_lock;
ShenandoahPeriodicTask _periodic_task;
ShenandoahPeriodicSATBFlushTask _periodic_satb_flush_task;
private:
static SurrogateLockerThread* _slt;
--- 62,75 ----
stw_degenerated,
stw_full,
} GCMode;
// While we could have a single lock for these, it may risk unblocking
! // GC waiters when alloc failure GC cycle finishes. We want instead
// to make complete explicit cycle for for demanding customers.
Monitor _alloc_failure_waiters_lock;
! Monitor _gc_waiters_lock;
ShenandoahPeriodicTask _periodic_task;
ShenandoahPeriodicSATBFlushTask _periodic_satb_flush_task;
private:
static SurrogateLockerThread* _slt;
*** 77,108 ****
public:
void run();
void stop();
private:
! ShenandoahSharedFlag _explicit_gc;
ShenandoahSharedFlag _alloc_failure_gc;
ShenandoahSharedFlag _graceful_shutdown;
ShenandoahSharedFlag _heap_changed;
ShenandoahSharedFlag _do_counters_update;
ShenandoahSharedFlag _force_counters_update;
! volatile intptr_t _allocs_seen;
! GCCause::Cause _explicit_gc_cause;
ShenandoahHeap::ShenandoahDegenPoint _degen_point;
bool check_cancellation_or_degen(ShenandoahHeap::ShenandoahDegenPoint point);
void service_concurrent_normal_cycle(GCCause::Cause cause);
void service_stw_full_cycle(GCCause::Cause cause);
void service_stw_degenerated_cycle(GCCause::Cause cause, ShenandoahHeap::ShenandoahDegenPoint point);
void service_uncommit(double shrink_before);
bool try_set_alloc_failure_gc();
void notify_alloc_failure_waiters();
bool is_alloc_failure_gc();
! void notify_explicit_gc_waiters();
public:
// Constructor
ShenandoahControlThread();
~ShenandoahControlThread();
--- 77,116 ----
public:
void run();
void stop();
private:
! ShenandoahSharedFlag _gc_requested;
ShenandoahSharedFlag _alloc_failure_gc;
ShenandoahSharedFlag _graceful_shutdown;
ShenandoahSharedFlag _heap_changed;
ShenandoahSharedFlag _do_counters_update;
ShenandoahSharedFlag _force_counters_update;
! GCCause::Cause _requested_gc_cause;
ShenandoahHeap::ShenandoahDegenPoint _degen_point;
+ char _pad0[DEFAULT_CACHE_LINE_SIZE];
+ volatile intptr_t _allocs_seen;
+ char _pad1[DEFAULT_CACHE_LINE_SIZE];
+
bool check_cancellation_or_degen(ShenandoahHeap::ShenandoahDegenPoint point);
void service_concurrent_normal_cycle(GCCause::Cause cause);
void service_stw_full_cycle(GCCause::Cause cause);
void service_stw_degenerated_cycle(GCCause::Cause cause, ShenandoahHeap::ShenandoahDegenPoint point);
void service_uncommit(double shrink_before);
bool try_set_alloc_failure_gc();
void notify_alloc_failure_waiters();
bool is_alloc_failure_gc();
! void notify_gc_waiters();
!
! // Handle GC request.
! // Blocks until GC is over.
! void handle_requested_gc(GCCause::Cause cause);
+ bool is_explicit_gc(GCCause::Cause cause) const;
public:
// Constructor
ShenandoahControlThread();
~ShenandoahControlThread();
*** 115,127 ****
// Handle allocation failure from evacuation path.
// Optionally blocks while collector is handling the failure.
void handle_alloc_failure_evac(size_t words);
! // Handle explicit GC request.
! // Blocks until GC is over.
! void handle_explicit_gc(GCCause::Cause cause);
void handle_counters_update();
void handle_force_counters_update();
void set_forced_counters_update(bool value);
--- 123,133 ----
// Handle allocation failure from evacuation path.
// Optionally blocks while collector is handling the failure.
void handle_alloc_failure_evac(size_t words);
! void request_gc(GCCause::Cause cause);
void handle_counters_update();
void handle_force_counters_update();
void set_forced_counters_update(bool value);
< prev index next >