1 /*
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
62 Mutex* ExpandHeap_lock = NULL;
63 Mutex* AdapterHandlerLibrary_lock = NULL;
64 Mutex* SignatureHandlerLibrary_lock = NULL;
65 Mutex* VtableStubs_lock = NULL;
66 Mutex* SymbolArena_lock = NULL;
67 Monitor* StringDedupQueue_lock = NULL;
68 Mutex* StringDedupTable_lock = NULL;
69 Monitor* CodeCache_lock = NULL;
70 Mutex* MethodData_lock = NULL;
71 Mutex* TouchedMethodLog_lock = NULL;
72 Mutex* RetData_lock = NULL;
73 Monitor* VMOperationQueue_lock = NULL;
74 Monitor* VMOperationRequest_lock = NULL;
75 Monitor* Safepoint_lock = NULL;
76 Monitor* SerializePage_lock = NULL;
77 Monitor* Threads_lock = NULL;
78 Mutex* NonJavaThreadsList_lock = NULL;
79 Monitor* CGC_lock = NULL;
80 Monitor* STS_lock = NULL;
81 Monitor* FullGCCount_lock = NULL;
82 Mutex* SATB_Q_FL_lock = NULL;
83 Monitor* SATB_Q_CBL_mon = NULL;
84 Mutex* Shared_SATB_Q_lock = NULL;
85 Mutex* DirtyCardQ_FL_lock = NULL;
86 Monitor* DirtyCardQ_CBL_mon = NULL;
87 Mutex* Shared_DirtyCardQ_lock = NULL;
88 Mutex* MarkStackFreeList_lock = NULL;
89 Mutex* MarkStackChunkList_lock = NULL;
90 Mutex* MonitoringSupport_lock = NULL;
91 Mutex* ParGCRareEvent_lock = NULL;
92 Mutex* DerivedPointerTableGC_lock = NULL;
93 Monitor* CGCPhaseManager_lock = NULL;
94 Mutex* Compile_lock = NULL;
95 Monitor* MethodCompileQueue_lock = NULL;
96 Monitor* CompileThread_lock = NULL;
97 Monitor* Compilation_lock = NULL;
98 Mutex* CompileTaskAlloc_lock = NULL;
99 Mutex* CompileStatistics_lock = NULL;
100 Mutex* DirectivesStack_lock = NULL;
101 Mutex* MultiArray_lock = NULL;
102 Monitor* Terminator_lock = NULL;
103 Monitor* BeforeExit_lock = NULL;
104 Monitor* Notify_lock = NULL;
105 Mutex* ProfilePrint_lock = NULL;
197 _mutex_array[_num_mutex++] = var; \
198 }
199
200 // Using Padded subclasses to prevent false sharing of these global monitors and mutexes.
201 void mutex_init() {
202 def(tty_lock , PaddedMutex , tty, true, Monitor::_safepoint_check_never); // allow to lock in VM
203
204 def(CGC_lock , PaddedMonitor, special, true, Monitor::_safepoint_check_never); // coordinate between fore- and background GC
205 def(STS_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never);
206
207 def(VMWeakAlloc_lock , PaddedMutex , vmweak, true, Monitor::_safepoint_check_never);
208 def(VMWeakActive_lock , PaddedMutex , vmweak-1, true, Monitor::_safepoint_check_never);
209
210 def(StringTableWeakAlloc_lock , PaddedMutex , vmweak, true, Monitor::_safepoint_check_never);
211 def(StringTableWeakActive_lock , PaddedMutex , vmweak-1, true, Monitor::_safepoint_check_never);
212
213 if (UseConcMarkSweepGC || UseG1GC) {
214 def(FullGCCount_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never); // in support of ExplicitGCInvokesConcurrent
215 }
216 if (UseG1GC) {
217 def(SATB_Q_FL_lock , PaddedMutex , access, true, Monitor::_safepoint_check_never);
218 def(SATB_Q_CBL_mon , PaddedMonitor, access, true, Monitor::_safepoint_check_never);
219 def(Shared_SATB_Q_lock , PaddedMutex , access + 1, true, Monitor::_safepoint_check_never);
220
221 def(DirtyCardQ_FL_lock , PaddedMutex , access, true, Monitor::_safepoint_check_never);
222 def(DirtyCardQ_CBL_mon , PaddedMonitor, access, true, Monitor::_safepoint_check_never);
223 def(Shared_DirtyCardQ_lock , PaddedMutex , access + 1, true, Monitor::_safepoint_check_never);
224
225 def(FreeList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
226 def(OldSets_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
227 def(RootRegionScan_lock , PaddedMonitor, leaf , true, Monitor::_safepoint_check_never);
228
229 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never);
230 def(StringDedupTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
231
232 def(MarkStackFreeList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
233 def(MarkStackChunkList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
234
235 def(MonitoringSupport_lock , PaddedMutex , native , true, Monitor::_safepoint_check_never); // used for serviceability monitoring support
236 }
237 if (UseShenandoahGC) {
238 def(SATB_Q_FL_lock , PaddedMutex , access, true, Monitor::_safepoint_check_never);
239 def(SATB_Q_CBL_mon , PaddedMonitor, access, true, Monitor::_safepoint_check_never);
240 def(Shared_SATB_Q_lock , PaddedMutex , access + 1, true, Monitor::_safepoint_check_never);
241
242 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never);
243 def(StringDedupTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
244 }
245 def(ParGCRareEvent_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_sometimes);
246 def(DerivedPointerTableGC_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
247 def(CGCPhaseManager_lock , PaddedMonitor, leaf, false, Monitor::_safepoint_check_sometimes);
248 def(CodeCache_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
249 def(RawMonitor_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
250 def(OopMapCacheAlloc_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for oop_map_cache allocation.
251
252 def(MetaspaceExpand_lock , PaddedMutex , leaf-1, true, Monitor::_safepoint_check_never);
253 def(ClassLoaderDataGraph_lock , PaddedMutex , nonleaf, true, Monitor::_safepoint_check_always);
254
255 def(Patching_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never); // used for safepointing and code patching.
256 def(Service_lock , PaddedMonitor, special, true, Monitor::_safepoint_check_never); // used for service thread operations
257 def(JmethodIdCreation_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for creating jmethodIDs.
258
|
1 /*
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
62 Mutex* ExpandHeap_lock = NULL;
63 Mutex* AdapterHandlerLibrary_lock = NULL;
64 Mutex* SignatureHandlerLibrary_lock = NULL;
65 Mutex* VtableStubs_lock = NULL;
66 Mutex* SymbolArena_lock = NULL;
67 Monitor* StringDedupQueue_lock = NULL;
68 Mutex* StringDedupTable_lock = NULL;
69 Monitor* CodeCache_lock = NULL;
70 Mutex* MethodData_lock = NULL;
71 Mutex* TouchedMethodLog_lock = NULL;
72 Mutex* RetData_lock = NULL;
73 Monitor* VMOperationQueue_lock = NULL;
74 Monitor* VMOperationRequest_lock = NULL;
75 Monitor* Safepoint_lock = NULL;
76 Monitor* SerializePage_lock = NULL;
77 Monitor* Threads_lock = NULL;
78 Mutex* NonJavaThreadsList_lock = NULL;
79 Monitor* CGC_lock = NULL;
80 Monitor* STS_lock = NULL;
81 Monitor* FullGCCount_lock = NULL;
82 Monitor* SATB_Q_CBL_mon = NULL;
83 Mutex* Shared_SATB_Q_lock = NULL;
84 Monitor* DirtyCardQ_CBL_mon = NULL;
85 Mutex* Shared_DirtyCardQ_lock = NULL;
86 Mutex* MarkStackFreeList_lock = NULL;
87 Mutex* MarkStackChunkList_lock = NULL;
88 Mutex* MonitoringSupport_lock = NULL;
89 Mutex* ParGCRareEvent_lock = NULL;
90 Mutex* DerivedPointerTableGC_lock = NULL;
91 Monitor* CGCPhaseManager_lock = NULL;
92 Mutex* Compile_lock = NULL;
93 Monitor* MethodCompileQueue_lock = NULL;
94 Monitor* CompileThread_lock = NULL;
95 Monitor* Compilation_lock = NULL;
96 Mutex* CompileTaskAlloc_lock = NULL;
97 Mutex* CompileStatistics_lock = NULL;
98 Mutex* DirectivesStack_lock = NULL;
99 Mutex* MultiArray_lock = NULL;
100 Monitor* Terminator_lock = NULL;
101 Monitor* BeforeExit_lock = NULL;
102 Monitor* Notify_lock = NULL;
103 Mutex* ProfilePrint_lock = NULL;
195 _mutex_array[_num_mutex++] = var; \
196 }
197
198 // Using Padded subclasses to prevent false sharing of these global monitors and mutexes.
199 void mutex_init() {
200 def(tty_lock , PaddedMutex , tty, true, Monitor::_safepoint_check_never); // allow to lock in VM
201
202 def(CGC_lock , PaddedMonitor, special, true, Monitor::_safepoint_check_never); // coordinate between fore- and background GC
203 def(STS_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never);
204
205 def(VMWeakAlloc_lock , PaddedMutex , vmweak, true, Monitor::_safepoint_check_never);
206 def(VMWeakActive_lock , PaddedMutex , vmweak-1, true, Monitor::_safepoint_check_never);
207
208 def(StringTableWeakAlloc_lock , PaddedMutex , vmweak, true, Monitor::_safepoint_check_never);
209 def(StringTableWeakActive_lock , PaddedMutex , vmweak-1, true, Monitor::_safepoint_check_never);
210
211 if (UseConcMarkSweepGC || UseG1GC) {
212 def(FullGCCount_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never); // in support of ExplicitGCInvokesConcurrent
213 }
214 if (UseG1GC) {
215 def(SATB_Q_CBL_mon , PaddedMonitor, access, true, Monitor::_safepoint_check_never);
216 def(Shared_SATB_Q_lock , PaddedMutex , access + 1, true, Monitor::_safepoint_check_never);
217
218 def(DirtyCardQ_CBL_mon , PaddedMonitor, access, true, Monitor::_safepoint_check_never);
219 def(Shared_DirtyCardQ_lock , PaddedMutex , access + 1, true, Monitor::_safepoint_check_never);
220
221 def(FreeList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
222 def(OldSets_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
223 def(RootRegionScan_lock , PaddedMonitor, leaf , true, Monitor::_safepoint_check_never);
224
225 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never);
226 def(StringDedupTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
227
228 def(MarkStackFreeList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
229 def(MarkStackChunkList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
230
231 def(MonitoringSupport_lock , PaddedMutex , native , true, Monitor::_safepoint_check_never); // used for serviceability monitoring support
232 }
233 if (UseShenandoahGC) {
234 def(SATB_Q_CBL_mon , PaddedMonitor, access, true, Monitor::_safepoint_check_never);
235 def(Shared_SATB_Q_lock , PaddedMutex , access + 1, true, Monitor::_safepoint_check_never);
236
237 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never);
238 def(StringDedupTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
239 }
240 def(ParGCRareEvent_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_sometimes);
241 def(DerivedPointerTableGC_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
242 def(CGCPhaseManager_lock , PaddedMonitor, leaf, false, Monitor::_safepoint_check_sometimes);
243 def(CodeCache_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
244 def(RawMonitor_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
245 def(OopMapCacheAlloc_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for oop_map_cache allocation.
246
247 def(MetaspaceExpand_lock , PaddedMutex , leaf-1, true, Monitor::_safepoint_check_never);
248 def(ClassLoaderDataGraph_lock , PaddedMutex , nonleaf, true, Monitor::_safepoint_check_always);
249
250 def(Patching_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never); // used for safepointing and code patching.
251 def(Service_lock , PaddedMonitor, special, true, Monitor::_safepoint_check_never); // used for service thread operations
252 def(JmethodIdCreation_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for creating jmethodIDs.
253
|