hotspot/src/share/vm/gc_implementation/g1/heapRegionSets.cpp
author tschatzl
Mon, 20 Jan 2014 11:47:07 +0100
changeset 22545 b93a7f0e9b9d
parent 10996 b9d07748e5b3
child 23450 c7c6202fc7e2
permissions -rw-r--r--
8027476: Improve performance of Stringtable unlink 8027455: Improve symbol table scan times during gc pauses Summary: Parallelize string table and symbol table scan during remark and full GC. Some additional statistics output if the experimental flag G1TraceStringSymbolTableScrubbing is set. Reviewed-by: mgerdin, coleenp, brutisso
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     1
/*
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     2
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     4
 *
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     8
 *
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    13
 * accompanied this code).
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    14
 *
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    18
 *
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    21
 * questions.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    22
 *
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    23
 */
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    24
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    25
#include "precompiled.hpp"
10000
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    26
#include "gc_implementation/g1/heapRegionRemSet.hpp"
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    27
#include "gc_implementation/g1/heapRegionSets.hpp"
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    28
10996
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    29
// Note on the check_mt_safety() methods below:
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    30
//
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    31
// Verification of the "master" heap region sets / lists that are
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    32
// maintained by G1CollectedHeap is always done during a STW pause and
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    33
// by the VM thread at the start / end of the pause. The standard
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    34
// verification methods all assert check_mt_safety(). This is
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    35
// important as it ensures that verification is done without
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    36
// concurrent updates taking place at the same time. It follows, that,
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    37
// for the "master" heap region sets / lists, the check_mt_safety()
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    38
// method should include the VM thread / STW case.
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    39
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    40
//////////////////// FreeRegionList ////////////////////
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    41
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    42
const char* FreeRegionList::verify_region_extra(HeapRegion* hr) {
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    43
  if (hr->is_young()) {
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    44
    return "the region should not be young";
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    45
  }
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    46
  // The superclass will check that the region is empty and
10996
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    47
  // not humongous.
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    48
  return HeapRegionLinkedList::verify_region_extra(hr);
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    49
}
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    50
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    51
//////////////////// MasterFreeRegionList ////////////////////
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    52
10000
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    53
const char* MasterFreeRegionList::verify_region_extra(HeapRegion* hr) {
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    54
  // We should reset the RSet for parallel iteration before we add it
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    55
  // to the master free list so that it is ready when the region is
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    56
  // re-allocated.
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    57
  if (!hr->rem_set()->verify_ready_for_par_iteration()) {
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    58
    return "the region's RSet should be ready for parallel iteration";
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    59
  }
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    60
  return FreeRegionList::verify_region_extra(hr);
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    61
}
5bbb58b0dbb9 7046182: G1: remove unnecessary iterations over the collection set
tonyp
parents: 8680
diff changeset
    62
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    63
bool MasterFreeRegionList::check_mt_safety() {
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    64
  // Master Free List MT safety protocol:
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    65
  // (a) If we're at a safepoint, operations on the master free list
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    66
  // should be invoked by either the VM thread (which will serialize
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    67
  // them) or by the GC workers while holding the
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    68
  // FreeList_lock.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    69
  // (b) If we're not at a safepoint, operations on the master free
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    70
  // list should be invoked while holding the Heap_lock.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    71
10996
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    72
  if (SafepointSynchronize::is_at_safepoint()) {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    73
    guarantee(Thread::current()->is_VM_thread() ||
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    74
              FreeList_lock->owned_by_self(),
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    75
              hrs_ext_msg(this, "master free list MT safety protocol "
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    76
                                "at a safepoint"));
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    77
  } else {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    78
    guarantee(Heap_lock->owned_by_self(),
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    79
              hrs_ext_msg(this, "master free list MT safety protocol "
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    80
                                "outside a safepoint"));
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    81
  }
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    82
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    83
  return FreeRegionList::check_mt_safety();
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    84
}
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    85
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    86
//////////////////// SecondaryFreeRegionList ////////////////////
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    87
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    88
bool SecondaryFreeRegionList::check_mt_safety() {
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    89
  // Secondary Free List MT safety protocol:
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    90
  // Operations on the secondary free list should always be invoked
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    91
  // while holding the SecondaryFreeList_lock.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    92
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    93
  guarantee(SecondaryFreeList_lock->owned_by_self(),
8680
f1c414e16a4c 7014923: G1: code cleanup
tonyp
parents: 7923
diff changeset
    94
            hrs_ext_msg(this, "secondary free list MT safety protocol"));
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    95
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    96
  return FreeRegionList::check_mt_safety();
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    97
}
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
    98
10996
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
    99
//////////////////// OldRegionSet ////////////////////
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   100
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   101
const char* OldRegionSet::verify_region_extra(HeapRegion* hr) {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   102
  if (hr->is_young()) {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   103
    return "the region should not be young";
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   104
  }
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   105
  // The superclass will check that the region is not empty and not
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   106
  // humongous.
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   107
  return HeapRegionSet::verify_region_extra(hr);
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   108
}
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   109
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   110
//////////////////// MasterOldRegionSet ////////////////////
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   111
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   112
bool MasterOldRegionSet::check_mt_safety() {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   113
  // Master Old Set MT safety protocol:
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   114
  // (a) If we're at a safepoint, operations on the master old set
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   115
  // should be invoked:
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   116
  // - by the VM thread (which will serialize them), or
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   117
  // - by the GC workers while holding the FreeList_lock, if we're
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   118
  //   at a safepoint for an evacuation pause (this lock is taken
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   119
  //   anyway when an GC alloc region is retired so that a new one
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   120
  //   is allocated from the free list), or
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   121
  // - by the GC workers while holding the OldSets_lock, if we're at a
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   122
  //   safepoint for a cleanup pause.
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   123
  // (b) If we're not at a safepoint, operations on the master old set
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   124
  // should be invoked while holding the Heap_lock.
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   125
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   126
  if (SafepointSynchronize::is_at_safepoint()) {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   127
    guarantee(Thread::current()->is_VM_thread() ||
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   128
              _phase == HRSPhaseEvacuation && FreeList_lock->owned_by_self() ||
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   129
              _phase == HRSPhaseCleanup && OldSets_lock->owned_by_self(),
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   130
              hrs_ext_msg(this, "master old set MT safety protocol "
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   131
                                "at a safepoint"));
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   132
  } else {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   133
    guarantee(Heap_lock->owned_by_self(),
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   134
              hrs_ext_msg(this, "master old set MT safety protocol "
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   135
                                "outside a safepoint"));
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   136
  }
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   137
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   138
  return OldRegionSet::check_mt_safety();
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   139
}
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   140
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   141
//////////////////// HumongousRegionSet ////////////////////
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   142
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   143
const char* HumongousRegionSet::verify_region_extra(HeapRegion* hr) {
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   144
  if (hr->is_young()) {
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   145
    return "the region should not be young";
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   146
  }
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   147
  // The superclass will check that the region is not empty and
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   148
  // humongous.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   149
  return HeapRegionSet::verify_region_extra(hr);
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   150
}
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   151
8680
f1c414e16a4c 7014923: G1: code cleanup
tonyp
parents: 7923
diff changeset
   152
//////////////////// MasterHumongousRegionSet ////////////////////
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   153
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   154
bool MasterHumongousRegionSet::check_mt_safety() {
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   155
  // Master Humongous Set MT safety protocol:
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   156
  // (a) If we're at a safepoint, operations on the master humongous
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   157
  // set should be invoked by either the VM thread (which will
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   158
  // serialize them) or by the GC workers while holding the
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   159
  // OldSets_lock.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   160
  // (b) If we're not at a safepoint, operations on the master
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   161
  // humongous set should be invoked while holding the Heap_lock.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   162
10996
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   163
  if (SafepointSynchronize::is_at_safepoint()) {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   164
    guarantee(Thread::current()->is_VM_thread() ||
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   165
              OldSets_lock->owned_by_self(),
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   166
              hrs_ext_msg(this, "master humongous set MT safety protocol "
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   167
                                "at a safepoint"));
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   168
  } else {
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   169
    guarantee(Heap_lock->owned_by_self(),
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   170
              hrs_ext_msg(this, "master humongous set MT safety protocol "
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   171
                                "outside a safepoint"));
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   172
  }
b9d07748e5b3 7092309: G1: introduce old region set
tonyp
parents: 10000
diff changeset
   173
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   174
  return HumongousRegionSet::check_mt_safety();
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents:
diff changeset
   175
}