Skip to content

Commit

Permalink
8331015: Obsolete -XX:+UseNotificationThread
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, kevinw, sspitsyn, coleenp
  • Loading branch information
Alex Menkov committed Jul 31, 2024
1 parent 97f7c03 commit 8af2ef3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -497,7 +497,7 @@ static bool prepare_for_emergency_dump(Thread* thread) {
Service_lock->unlock();
}

if (UseNotificationThread && Notification_lock->owned_by_self()) {
if (Notification_lock->owned_by_self()) {
Notification_lock->unlock();
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ static SpecialFlag const special_jvm_flags[] = {
{ "RequireSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() },
{ "UseSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() },
{ "DontYieldALot", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
{ "UseNotificationThread", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
{ "LockingMode", JDK_Version::jdk(24), JDK_Version::jdk(26), JDK_Version::jdk(27) },
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
{ "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
Expand All @@ -512,6 +511,7 @@ static SpecialFlag const special_jvm_flags[] = {

{ "MetaspaceReclaimPolicy", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },

{ "UseNotificationThread", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
{ "PreserveAllAnnotations", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
{ "UseEmptySlotsInSupers", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
{ "OldSize", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/runtime/globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,6 @@ const int ObjectAlignmentInBytes = 8;
product(bool, EnableThreadSMRStatistics, trueInDebug, DIAGNOSTIC, \
"Enable Thread SMR Statistics") \
\
product(bool, UseNotificationThread, true, \
"(Deprecated) Use Notification Thread") \
\
product(bool, Inline, true, \
"Enable inlining") \
\
Expand Down
9 changes: 2 additions & 7 deletions src/hotspot/share/runtime/mutexLocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,8 @@ void mutex_init() {

MUTEX_DEFN(Patching_lock , PaddedMutex , nosafepoint); // used for safepointing and code patching.
MUTEX_DEFN(MonitorDeflation_lock , PaddedMonitor, nosafepoint); // used for monitor deflation thread operations
MUTEX_DEFN(Service_lock , PaddedMonitor, service); // used for service thread operations

if (UseNotificationThread) {
MUTEX_DEFN(Notification_lock , PaddedMonitor, service); // used for notification thread operations
} else {
Notification_lock = Service_lock;
}
MUTEX_DEFN(Service_lock , PaddedMonitor, service); // used for service thread operations
MUTEX_DEFN(Notification_lock , PaddedMonitor, service); // used for notification thread operations

MUTEX_DEFN(JmethodIdCreation_lock , PaddedMutex , nosafepoint-2); // used for creating jmethodIDs.
MUTEX_DEFN(InvokeMethodTypeTable_lock , PaddedMutex , safepoint);
Expand Down
22 changes: 1 addition & 21 deletions src/hotspot/share/runtime/serviceThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ static void cleanup_oopstorages() {

void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
while (true) {
bool sensors_changed = false;
bool has_jvmti_events = false;
bool has_gc_notification_event = false;
bool has_dcmd_notification_event = false;
bool stringtable_work = false;
bool symboltable_work = false;
bool finalizerservice_work = false;
Expand Down Expand Up @@ -113,10 +110,7 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
// only the first recognized bit of work, to avoid frequently true early
// tests from potentially starving later work. Hence the use of
// arithmetic-or to combine results; we don't want short-circuiting.
while (((sensors_changed = (!UseNotificationThread && LowMemoryDetector::has_pending_requests())) |
(has_jvmti_events = _jvmti_service_queue.has_events()) |
(has_gc_notification_event = (!UseNotificationThread && GCNotifier::has_event())) |
(has_dcmd_notification_event = (!UseNotificationThread && DCmdFactory::has_pending_jmx_notification())) |
while (((has_jvmti_events = _jvmti_service_queue.has_events()) |
(stringtable_work = StringTable::has_work()) |
(symboltable_work = SymbolTable::has_work()) |
(finalizerservice_work = FinalizerService::has_work()) |
Expand Down Expand Up @@ -158,20 +152,6 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
_jvmti_event = nullptr; // reset
}

if (!UseNotificationThread) {
if (sensors_changed) {
LowMemoryDetector::process_sensor_changes(jt);
}

if(has_gc_notification_event) {
GCNotifier::sendNotification(CHECK);
}

if(has_dcmd_notification_event) {
DCmdFactory::send_notification(CHECK);
}
}

if (resolved_method_table_work) {
ResolvedMethodTable::do_concurrent_work(jt);
}
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/share/services/lowMemoryDetector.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,8 +61,7 @@
//
// May need to deal with hysteresis effect.
//
// Memory detection code runs in the Notification thread or
// ServiceThread depending on UseNotificationThread flag.
// Memory detection code runs in the Notification thread.

class OopClosure;
class MemoryPool;
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/share/services/management.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ void Management::init() {
}

void Management::initialize(TRAPS) {
if (UseNotificationThread) {
NotificationThread::initialize();
}
NotificationThread::initialize();

if (ManagementServer) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
Expand Down

0 comments on commit 8af2ef3

Please sign in to comment.