Remove experimental MetaspaceSeparateMicroCLDs feature, since its effect was underwhelming stuefe-new-metaspace-branch
authorstuefe
Wed, 16 Oct 2019 16:10:24 +0200
branchstuefe-new-metaspace-branch
changeset 58646 bcdba1c9f1fe
parent 58645 28c7e6711871
child 58651 a2d3074db7a9
Remove experimental MetaspaceSeparateMicroCLDs feature, since its effect was underwhelming
src/hotspot/share/memory/metaspace.cpp
src/hotspot/share/memory/metaspace/chunkManager.cpp
src/hotspot/share/memory/metaspace/chunkManager.hpp
src/hotspot/share/memory/metaspace/classLoaderMetaspace.cpp
src/hotspot/share/memory/metaspace/classLoaderMetaspace.hpp
src/hotspot/share/memory/metaspace/commitMask.hpp
src/hotspot/share/memory/metaspace/settings.cpp
src/hotspot/share/memory/metaspace/settings.hpp
src/hotspot/share/runtime/globals.hpp
--- a/src/hotspot/share/memory/metaspace.cpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace.cpp	Wed Oct 16 16:10:24 2019 +0200
@@ -716,10 +716,6 @@
   ChunkManager* cm = new ChunkManager("class space chunk manager", vsl);
   ChunkManager::set_chunkmanager_class(cm);
 
-  if (metaspace::Settings::separate_micro_cld_allocations()) {
-    ChunkManager* cm2 = new ChunkManager("microcld class space chunk manager", vsl);
-    ChunkManager::set_chunkmanager_microclds_class(cm2);
-  }
 }
 
 
@@ -839,11 +835,6 @@
   ChunkManager* cm = new ChunkManager("non-class chunkmanager", vsl);
   ChunkManager::set_chunkmanager_nonclass(cm);
 
-  if (metaspace::Settings::separate_micro_cld_allocations()) {
-    ChunkManager* cm2 = new ChunkManager("microcld non-class chunk manager", vsl);
-    ChunkManager::set_chunkmanager_microclds_nonclass(cm2);
-  }
-
   _tracer = new MetaspaceTracer();
 
   _initialized = true;
--- a/src/hotspot/share/memory/metaspace/chunkManager.cpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/chunkManager.cpp	Wed Oct 16 16:10:24 2019 +0200
@@ -425,18 +425,6 @@
   _chunkmanager_nonclass = cm;
 }
 
-ChunkManager* ChunkManager::_chunkmanager_microclds_class = NULL;
-ChunkManager* ChunkManager::_chunkmanager_microclds_nonclass = NULL;
-
-void ChunkManager::set_chunkmanager_microclds_class(ChunkManager* cm) {
-  assert(_chunkmanager_microclds_class == NULL, "Sanity");
-  _chunkmanager_microclds_class = cm;
-}
-
-void ChunkManager::set_chunkmanager_microclds_nonclass(ChunkManager* cm) {
-  assert(_chunkmanager_microclds_nonclass == NULL, "Sanity");
-  _chunkmanager_microclds_nonclass = cm;
-}
 
 
 // Update statistics.
--- a/src/hotspot/share/memory/metaspace/chunkManager.hpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/chunkManager.hpp	Wed Oct 16 16:10:24 2019 +0200
@@ -156,20 +156,6 @@
   static void set_chunkmanager_class(ChunkManager* cm);
   static void set_chunkmanager_nonclass(ChunkManager* cm);
 
-  // If micro clds are kept separate...
-private:
-
-  static ChunkManager* _chunkmanager_microclds_class;
-  static ChunkManager* _chunkmanager_microclds_nonclass;
-
-public:
-
-  static ChunkManager* chunkmanager_microclds_class() { return _chunkmanager_microclds_class; }
-  static ChunkManager* chunkmanager_microclds_nonclass() { return _chunkmanager_microclds_nonclass; }
-
-  static void set_chunkmanager_microclds_class(ChunkManager* cm);
-  static void set_chunkmanager_microclds_nonclass(ChunkManager* cm);
-
 
 };
 
--- a/src/hotspot/share/memory/metaspace/classLoaderMetaspace.cpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/classLoaderMetaspace.cpp	Wed Oct 16 16:10:24 2019 +0200
@@ -48,11 +48,6 @@
   return false;
 }
 
-static bool is_micro_cld(MetaspaceType space_type) {
-  return space_type == metaspace::UnsafeAnonymousMetaspaceType ||
-         space_type == metaspace::ReflectionMetaspaceType;
-}
-
 static bool use_class_space(MetadataType mdType) {
   return use_class_space(is_class(mdType));
 }
@@ -64,8 +59,6 @@
   , _class_space_manager(NULL)
 {
   ChunkManager* const non_class_cm =
-      is_micro_cld(_space_type) && Settings::separate_micro_cld_allocations() ?
-          ChunkManager::chunkmanager_microclds_nonclass() :
           ChunkManager::chunkmanager_nonclass();
 
   // Initialize non-class spacemanager
@@ -79,8 +72,6 @@
   // If needed, initialize class spacemanager
   if (Metaspace::using_class_space()) {
     ChunkManager* const class_cm =
-        is_micro_cld(_space_type) && Settings::separate_micro_cld_allocations() ?
-            ChunkManager::chunkmanager_microclds_class() :
             ChunkManager::chunkmanager_class();
     _class_space_manager = new SpaceManager(
         class_cm,
--- a/src/hotspot/share/memory/metaspace/classLoaderMetaspace.hpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/classLoaderMetaspace.hpp	Wed Oct 16 16:10:24 2019 +0200
@@ -54,6 +54,12 @@
     return is_class ? class_space_manager() : non_class_space_manager();
   }
 
+  // Returns true if this class loader is of a type which will only ever load one class.
+  bool is_micro() const {
+    return _space_type == metaspace::UnsafeAnonymousMetaspaceType ||
+           _space_type == metaspace::ReflectionMetaspaceType;
+  }
+
 public:
 
   ClassLoaderMetaspace(Mutex* lock, MetaspaceType space_type);
--- a/src/hotspot/share/memory/metaspace/commitMask.hpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/commitMask.hpp	Wed Oct 16 16:10:24 2019 +0200
@@ -130,15 +130,6 @@
     return at(bitno);
   }
 
-  // Given an address range [start..end), returns true if area is fully committed through.
-  bool is_fully_committed_range(const MetaWord* start, size_t word_size) const {
-    DEBUG_ONLY(check_range(start, word_size));
-    assert(word_size > 0, "zero range");
-    const idx_t b1 = bitno_for_address(start);
-    const idx_t b2 = bitno_for_address(start + word_size);
-    return get_next_zero_offset(b1, b2) == b2;
-  }
-
   // Given an address range, return size, in number of words, of committed area within that range.
   size_t get_committed_size_in_range(const MetaWord* start, size_t word_size) const {
     DEBUG_ONLY(check_range(start, word_size));
--- a/src/hotspot/share/memory/metaspace/settings.cpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/settings.cpp	Wed Oct 16 16:10:24 2019 +0200
@@ -54,7 +54,6 @@
 size_t Settings::_uncommit_on_purge_min_word_size = 0;
 
 
-bool Settings::_separate_micro_cld_allocations = false;
 
 void Settings::ergo_initialize() {
 
@@ -131,9 +130,6 @@
   _enlarge_chunks_in_place = MetaspaceEnlargeChunksInPlace;
   _enlarge_chunks_in_place_max_word_size = 256 * K;
 
-  // Optionally, we can shepherd micro cld metaspace allocs to an own root chunk.
-  _separate_micro_cld_allocations = MetaspaceSeparateMicroCLDs;
-
   // Sanity checks.
   guarantee(commit_granule_words() <= chklvl::MAX_CHUNK_WORD_SIZE, "Too large granule size");
   guarantee(is_power_of_2(commit_granule_words()), "granule size must be a power of 2");
--- a/src/hotspot/share/memory/metaspace/settings.hpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/settings.hpp	Wed Oct 16 16:10:24 2019 +0200
@@ -84,10 +84,6 @@
   // Must be a multiple of and not smaller than commit granularity.
   static size_t _uncommit_on_purge_min_word_size;
 
-  // If true, allocations from micro-clds (CLDs which only load one class, e.g. hidden classes or
-  // reflection loaders) are shepherded into an own root chunk.
-  static bool _separate_micro_cld_allocations;
-
 public:
 
   static size_t commit_granule_bytes()                        { return _commit_granule_bytes; }
@@ -103,7 +99,6 @@
   static bool delete_nodes_on_purge()                         { return _delete_nodes_on_purge; }
   static bool uncommit_on_purge()                             { return _uncommit_on_purge; }
   static size_t uncommit_on_purge_min_word_size()             { return _uncommit_on_purge_min_word_size; }
-  static bool separate_micro_cld_allocations()                { return _separate_micro_cld_allocations; }
 
   static void ergo_initialize();
 
--- a/src/hotspot/share/runtime/globals.hpp	Wed Oct 16 15:31:05 2019 +0200
+++ b/src/hotspot/share/runtime/globals.hpp	Wed Oct 16 16:10:24 2019 +0200
@@ -1612,9 +1612,6 @@
   product(ccstr, MetaspaceReclaimStrategy, "balanced",                      \
           "options: balanced, aggressive, none")                            \
                                                                             \
-  product(bool, MetaspaceSeparateMicroCLDs, false,                          \
-          "Micro CLDs are separated.")                                      \
-                                                                            \
   product(bool, MetaspaceEnlargeChunksInPlace, true,                        \
           "Metapace chunks are enlarged in place.")                         \
                                                                             \