< prev index next >

src/hotspot/share/gc/g1/heapRegionManager.cpp

Print this page


  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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/g1/g1Arguments.hpp"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/g1/g1ConcurrentRefine.hpp"
  29 #include "gc/g1/g1NUMAStats.hpp"
  30 #include "gc/g1/heapRegion.hpp"
  31 #include "gc/g1/heapRegionManager.inline.hpp"
  32 #include "gc/g1/heapRegionSet.inline.hpp"
  33 #include "gc/g1/heterogeneousHeapRegionManager.hpp"

  34 #include "logging/logStream.hpp"
  35 #include "memory/allocation.hpp"
  36 #include "runtime/atomic.hpp"
  37 #include "runtime/orderAccess.hpp"
  38 #include "utilities/bitMap.inline.hpp"
  39 
  40 class MasterFreeRegionListChecker : public HeapRegionSetChecker {
  41 public:
  42   void check_mt_safety() {
  43     // Master Free List MT safety protocol:
  44     // (a) If we're at a safepoint, operations on the master free list
  45     // should be invoked by either the VM thread (which will serialize
  46     // them) or by the GC workers while holding the
  47     // FreeList_lock.
  48     // (b) If we're not at a safepoint, operations on the master free
  49     // list should be invoked while holding the Heap_lock.
  50 
  51     if (SafepointSynchronize::is_at_safepoint()) {
  52       guarantee(Thread::current()->is_VM_thread() ||
  53                 FreeList_lock->owned_by_self(), "master free list MT safety protocol at a safepoint");




  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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/g1/g1Arguments.hpp"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/g1/g1ConcurrentRefine.hpp"
  29 #include "gc/g1/g1NUMAStats.hpp"
  30 #include "gc/g1/heapRegion.hpp"
  31 #include "gc/g1/heapRegionManager.inline.hpp"
  32 #include "gc/g1/heapRegionSet.inline.hpp"
  33 #include "gc/g1/heterogeneousHeapRegionManager.hpp"
  34 #include "jfr/jfrEvents.hpp"
  35 #include "logging/logStream.hpp"
  36 #include "memory/allocation.hpp"
  37 #include "runtime/atomic.hpp"
  38 #include "runtime/orderAccess.hpp"
  39 #include "utilities/bitMap.inline.hpp"
  40 
  41 class MasterFreeRegionListChecker : public HeapRegionSetChecker {
  42 public:
  43   void check_mt_safety() {
  44     // Master Free List MT safety protocol:
  45     // (a) If we're at a safepoint, operations on the master free list
  46     // should be invoked by either the VM thread (which will serialize
  47     // them) or by the GC workers while holding the
  48     // FreeList_lock.
  49     // (b) If we're not at a safepoint, operations on the master free
  50     // list should be invoked while holding the Heap_lock.
  51 
  52     if (SafepointSynchronize::is_at_safepoint()) {
  53       guarantee(Thread::current()->is_VM_thread() ||
  54                 FreeList_lock->owned_by_self(), "master free list MT safety protocol at a safepoint");


< prev index next >