1
1
/*
2
- * Copyright (c) 2018, 2020 , Oracle and/or its affiliates. All rights reserved.
3
- * Copyright (c) 2018, 2020 SAP SE. All rights reserved.
2
+ * Copyright (c) 2018, 2021 , Oracle and/or its affiliates. All rights reserved.
3
+ * Copyright (c) 2018, 2021 SAP SE. All rights reserved.
4
4
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
5
*
6
6
* This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@ namespace metaspace {
47
47
48
48
// Return a single chunk to the freelist and adjust accounting. No merge is attempted.
49
49
void ChunkManager::return_chunk_simple_locked(Metachunk* c) {
50
- assert_lock_strong (MetaspaceExpand_lock );
50
+ assert_lock_strong (Metaspace_lock );
51
51
DEBUG_ONLY (c->verify ());
52
52
_chunks.add (c);
53
53
c->reset_used_words ();
@@ -75,7 +75,7 @@ ChunkManager::ChunkManager(const char* name, VirtualSpaceList* space_list) :
75
75
// The committed areas within the original chunk carry over to the resulting
76
76
// chunks.
77
77
void ChunkManager::split_chunk_and_add_splinters (Metachunk* c, chunklevel_t target_level) {
78
- assert_lock_strong (MetaspaceExpand_lock );
78
+ assert_lock_strong (Metaspace_lock );
79
79
assert (c->is_free (), " chunk to be split must be free." );
80
80
assert (c->level () < target_level, " Target level must be higher than current level." );
81
81
assert (c->prev () == NULL && c->next () == NULL , " Chunk must be outside of any list." );
@@ -121,7 +121,7 @@ Metachunk* ChunkManager::get_chunk(chunklevel_t preferred_level, chunklevel_t ma
121
121
assert (preferred_level <= max_level, " Sanity" );
122
122
assert (chunklevel::level_fitting_word_size (min_committed_words) >= max_level, " Sanity" );
123
123
124
- MutexLocker fcl (MetaspaceExpand_lock , Mutex::_no_safepoint_check_flag);
124
+ MutexLocker fcl (Metaspace_lock , Mutex::_no_safepoint_check_flag);
125
125
126
126
DEBUG_ONLY (verify_locked ();)
127
127
DEBUG_ONLY (chunklevel::check_valid_level (max_level);)
@@ -232,13 +232,13 @@ Metachunk* ChunkManager::get_chunk(chunklevel_t preferred_level, chunklevel_t ma
232
232
// !! Note: this may invalidate the chunk. Do not access the chunk after
233
233
// this function returns !!
234
234
void ChunkManager::return_chunk (Metachunk* c) {
235
- MutexLocker fcl (MetaspaceExpand_lock , Mutex::_no_safepoint_check_flag);
235
+ MutexLocker fcl (Metaspace_lock , Mutex::_no_safepoint_check_flag);
236
236
return_chunk_locked (c);
237
237
}
238
238
239
239
// See return_chunk().
240
240
void ChunkManager::return_chunk_locked (Metachunk* c) {
241
- assert_lock_strong (MetaspaceExpand_lock );
241
+ assert_lock_strong (Metaspace_lock );
242
242
UL2 (debug, " : returning chunk " METACHUNK_FORMAT " ." , METACHUNK_FORMAT_ARGS (c));
243
243
DEBUG_ONLY (c->verify ();)
244
244
assert (contains_chunk (c) == false , " A chunk to be added to the freelist must not be in the freelist already." );
@@ -286,7 +286,7 @@ void ChunkManager::return_chunk_locked(Metachunk* c) {
286
286
//
287
287
// On success, true is returned, false otherwise.
288
288
bool ChunkManager::attempt_enlarge_chunk (Metachunk* c) {
289
- MutexLocker fcl (MetaspaceExpand_lock , Mutex::_no_safepoint_check_flag);
289
+ MutexLocker fcl (Metaspace_lock , Mutex::_no_safepoint_check_flag);
290
290
return c->vsnode ()->attempt_enlarge_chunk (c, &_chunks);
291
291
}
292
292
@@ -311,7 +311,7 @@ static void print_word_size_delta(outputStream* st, size_t word_size_1, size_t w
311
311
}
312
312
313
313
void ChunkManager::purge () {
314
- MutexLocker fcl (MetaspaceExpand_lock , Mutex::_no_safepoint_check_flag);
314
+ MutexLocker fcl (Metaspace_lock , Mutex::_no_safepoint_check_flag);
315
315
UL (info, " : reclaiming memory..." );
316
316
317
317
const size_t reserved_before = _vslist->reserved_words ();
@@ -384,18 +384,18 @@ ChunkManager* ChunkManager::chunkmanager_nonclass() {
384
384
385
385
// Calculates the total number of committed words over all chunks. Walks chunks.
386
386
size_t ChunkManager::calc_committed_word_size () const {
387
- MutexLocker fcl (MetaspaceExpand_lock , Mutex::_no_safepoint_check_flag);
387
+ MutexLocker fcl (Metaspace_lock , Mutex::_no_safepoint_check_flag);
388
388
return calc_committed_word_size_locked ();
389
389
}
390
390
391
391
size_t ChunkManager::calc_committed_word_size_locked () const {
392
- assert_lock_strong (MetaspaceExpand_lock );
392
+ assert_lock_strong (Metaspace_lock );
393
393
return _chunks.calc_committed_word_size ();
394
394
}
395
395
396
396
// Update statistics.
397
397
void ChunkManager::add_to_statistics (ChunkManagerStats* out) const {
398
- MutexLocker fcl (MetaspaceExpand_lock , Mutex::_no_safepoint_check_flag);
398
+ MutexLocker fcl (Metaspace_lock , Mutex::_no_safepoint_check_flag);
399
399
for (chunklevel_t l = chunklevel::ROOT_CHUNK_LEVEL; l <= chunklevel::HIGHEST_CHUNK_LEVEL; l++) {
400
400
out->_num_chunks [l] += _chunks.num_chunks_at_level (l);
401
401
out->_committed_word_size [l] += _chunks.calc_committed_word_size_at_level (l);
@@ -406,12 +406,12 @@ void ChunkManager::add_to_statistics(ChunkManagerStats* out) const {
406
406
#ifdef ASSERT
407
407
408
408
void ChunkManager::verify () const {
409
- MutexLocker fcl (MetaspaceExpand_lock , Mutex::_no_safepoint_check_flag);
409
+ MutexLocker fcl (Metaspace_lock , Mutex::_no_safepoint_check_flag);
410
410
verify_locked ();
411
411
}
412
412
413
413
void ChunkManager::verify_locked () const {
414
- assert_lock_strong (MetaspaceExpand_lock );
414
+ assert_lock_strong (Metaspace_lock );
415
415
assert (_vslist != NULL , " No vslist" );
416
416
_chunks.verify ();
417
417
}
@@ -423,12 +423,12 @@ bool ChunkManager::contains_chunk(Metachunk* c) const {
423
423
#endif // ASSERT
424
424
425
425
void ChunkManager::print_on (outputStream* st) const {
426
- MutexLocker fcl (MetaspaceExpand_lock , Mutex::_no_safepoint_check_flag);
426
+ MutexLocker fcl (Metaspace_lock , Mutex::_no_safepoint_check_flag);
427
427
print_on_locked (st);
428
428
}
429
429
430
430
void ChunkManager::print_on_locked (outputStream* st) const {
431
- assert_lock_strong (MetaspaceExpand_lock );
431
+ assert_lock_strong (Metaspace_lock );
432
432
st->print_cr (" cm %s: %d chunks, total word size: " SIZE_FORMAT " ." , _name,
433
433
total_num_chunks (), total_word_size ());
434
434
_chunks.print_on (st);
0 commit comments