Skip to content

Commit 431338b

Browse files
committed
8212107: VMThread issues and cleanup
Reviewed-by: shade, dcubed, coleenp, dholmes, redestad
1 parent 6bddeb7 commit 431338b

File tree

8 files changed

+221
-334
lines changed

8 files changed

+221
-334
lines changed

src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,8 @@ static bool prepare_for_emergency_dump(Thread* thread) {
454454
Heap_lock->unlock();
455455
}
456456

457-
if (VMOperationQueue_lock->owned_by_self()) {
458-
VMOperationQueue_lock->unlock();
459-
}
460-
461-
if (VMOperationRequest_lock->owned_by_self()) {
462-
VMOperationRequest_lock->unlock();
457+
if (VMOperation_lock->owned_by_self()) {
458+
VMOperation_lock->unlock();
463459
}
464460

465461
if (Service_lock->owned_by_self()) {

src/hotspot/share/runtime/mutexLocker.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ Monitor* CodeSweeper_lock = NULL;
6565
Mutex* MethodData_lock = NULL;
6666
Mutex* TouchedMethodLog_lock = NULL;
6767
Mutex* RetData_lock = NULL;
68-
Monitor* VMOperationQueue_lock = NULL;
69-
Monitor* VMOperationRequest_lock = NULL;
68+
Monitor* VMOperation_lock = NULL;
7069
Monitor* Threads_lock = NULL;
7170
Mutex* NonJavaThreadsList_lock = NULL;
7271
Mutex* NonJavaThreadsListSync_lock = NULL;
@@ -280,8 +279,7 @@ void mutex_init() {
280279
def(NonJavaThreadsList_lock , PaddedMutex, barrier, true, _safepoint_check_never);
281280
def(NonJavaThreadsListSync_lock , PaddedMutex, leaf, true, _safepoint_check_never);
282281

283-
def(VMOperationQueue_lock , PaddedMonitor, nonleaf, true, _safepoint_check_never); // VM_thread allowed to block on these
284-
def(VMOperationRequest_lock , PaddedMonitor, nonleaf, true, _safepoint_check_always);
282+
def(VMOperation_lock , PaddedMonitor, nonleaf, true, _safepoint_check_always); // VM_thread allowed to block on these
285283
def(RetData_lock , PaddedMutex , nonleaf, false, _safepoint_check_always);
286284
def(Terminator_lock , PaddedMonitor, nonleaf, true, _safepoint_check_always);
287285
def(InitCompleted_lock , PaddedMonitor, leaf, true, _safepoint_check_never);

src/hotspot/share/runtime/mutexLocker.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ extern Monitor* CodeSweeper_lock; // a lock used by the sweeper o
5858
extern Mutex* MethodData_lock; // a lock on installation of method data
5959
extern Mutex* TouchedMethodLog_lock; // a lock on allocation of LogExecutedMethods info
6060
extern Mutex* RetData_lock; // a lock on installation of RetData inside method data
61-
extern Monitor* VMOperationQueue_lock; // a lock on queue of vm_operations waiting to execute
62-
extern Monitor* VMOperationRequest_lock; // a lock on Threads waiting for a vm_operation to terminate
61+
extern Monitor* VMOperation_lock; // a lock on queue of vm_operations waiting to execute
6362
extern Monitor* Threads_lock; // a lock on the Threads table of active Java threads
6463
// (also used by Safepoints too to block threads creation/destruction)
6564
extern Mutex* NonJavaThreadsList_lock; // a lock on the NonJavaThreads list

src/hotspot/share/runtime/thread.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,6 @@ Thread::Thread() {
255255
NOT_PRODUCT(_skip_gcalot = false;)
256256
_jvmti_env_iteration_count = 0;
257257
set_allocated_bytes(0);
258-
_vm_operation_started_count = 0;
259-
_vm_operation_completed_count = 0;
260258
_current_pending_monitor = NULL;
261259
_current_pending_monitor_is_from_java = true;
262260
_current_waiting_monitor = NULL;

src/hotspot/share/runtime/thread.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,6 @@ class Thread: public ThreadShadow {
401401

402402
JFR_ONLY(DEFINE_THREAD_LOCAL_FIELD_JFR;) // Thread-local data for jfr
403403

404-
int _vm_operation_started_count; // VM_Operation support
405-
int _vm_operation_completed_count; // VM_Operation support
406-
407404
ObjectMonitor* _current_pending_monitor; // ObjectMonitor this thread
408405
// is waiting to lock
409406
bool _current_pending_monitor_is_from_java; // locking is from Java code
@@ -621,11 +618,6 @@ class Thread: public ThreadShadow {
621618

622619
bool is_trace_suspend() { return (_suspend_flags & _trace_flag) != 0; }
623620

624-
// VM operation support
625-
int vm_operation_ticket() { return ++_vm_operation_started_count; }
626-
int vm_operation_completed_count() { return _vm_operation_completed_count; }
627-
void increment_vm_operation_completed_count() { _vm_operation_completed_count++; }
628-
629621
// For tracking the heavyweight monitor the thread is pending on.
630622
ObjectMonitor* current_pending_monitor() {
631623
return _current_pending_monitor;

src/hotspot/share/runtime/vmOperations.hpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,12 @@ class VM_Operation : public StackObj {
121121

122122
private:
123123
Thread* _calling_thread;
124-
VM_Operation* _next;
125-
VM_Operation* _prev;
126124

127125
// The VM operation name array
128126
static const char* _names[];
129127

130128
public:
131-
VM_Operation() : _calling_thread(NULL), _next(NULL), _prev(NULL) {}
129+
VM_Operation() : _calling_thread(NULL) {}
132130

133131
// VM operation support (used by VM thread)
134132
Thread* calling_thread() const { return _calling_thread; }
@@ -148,12 +146,6 @@ class VM_Operation : public StackObj {
148146
virtual bool doit_prologue() { return true; };
149147
virtual void doit_epilogue() {};
150148

151-
// Linking
152-
VM_Operation *next() const { return _next; }
153-
VM_Operation *prev() const { return _prev; }
154-
void set_next(VM_Operation *next) { _next = next; }
155-
void set_prev(VM_Operation *prev) { _prev = prev; }
156-
157149
// Configuration. Override these appropriately in subclasses.
158150
virtual VMOp_Type type() const = 0;
159151
virtual bool allow_nested_vm_operations() const { return false; }

0 commit comments

Comments
 (0)