diff --git a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp index e0bbd8a6ddc..0759d02cb7c 100644 --- a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp +++ b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp @@ -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 @@ -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(); } diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 23b53300441..9086a5f6c71 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -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() }, @@ -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) }, diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 562549f247e..61efc0b9376 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -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") \ \ diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp index add47738db0..a63014d78a1 100644 --- a/src/hotspot/share/runtime/mutexLocker.cpp +++ b/src/hotspot/share/runtime/mutexLocker.cpp @@ -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); diff --git a/src/hotspot/share/runtime/serviceThread.cpp b/src/hotspot/share/runtime/serviceThread.cpp index f02e5062e67..a81285ac97c 100644 --- a/src/hotspot/share/runtime/serviceThread.cpp +++ b/src/hotspot/share/runtime/serviceThread.cpp @@ -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; @@ -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()) | @@ -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); } diff --git a/src/hotspot/share/services/lowMemoryDetector.hpp b/src/hotspot/share/services/lowMemoryDetector.hpp index 5c1201b4641..73491ea8412 100644 --- a/src/hotspot/share/services/lowMemoryDetector.hpp +++ b/src/hotspot/share/services/lowMemoryDetector.hpp @@ -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 @@ -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; diff --git a/src/hotspot/share/services/management.cpp b/src/hotspot/share/services/management.cpp index a9bb72a481a..2c9f36c098d 100644 --- a/src/hotspot/share/services/management.cpp +++ b/src/hotspot/share/services/management.cpp @@ -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);