src/hotspot/share/gc/g1/g1HotCardCache.hpp
author tschatzl
Fri, 29 Nov 2019 10:20:14 +0100
changeset 59319 9ee940f1de90
parent 58264 4e96939a5746
permissions -rw-r--r--
8227739: Merge cost predictions for scanning cards and log buffer entries Summary: Revamp the cost predictions for the changes in JDK-8200545 and JDK-8213108. Reviewed-by: sjohanss, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 47885
diff changeset
     2
 * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
     4
 *
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
     7
 * published by the Free Software Foundation.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
     8
 *
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    13
 * accompanied this code).
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    14
 *
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    18
 *
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    21
 * questions.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    22
 *
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    23
 */
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 47885
diff changeset
    25
#ifndef SHARE_GC_G1_G1HOTCARDCACHE_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 47885
diff changeset
    26
#define SHARE_GC_G1_G1HOTCARDCACHE_HPP
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    27
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30175
diff changeset
    28
#include "gc/g1/g1CardCounts.hpp"
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    29
#include "memory/allocation.hpp"
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    30
#include "runtime/safepoint.hpp"
30175
543725014c9d 8076457: Fix includes of inline.hpp in GC code
stefank
parents: 29203
diff changeset
    31
#include "runtime/thread.hpp"
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    32
#include "utilities/globalDefinitions.hpp"
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    33
53747
13acc8e38a29 8218089: Rename DirtyCardQueue et al to follow usual G1 naming conventions
kbarrett
parents: 53244
diff changeset
    34
class G1CardTableEntryClosure;
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    35
class G1CollectedHeap;
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    36
class HeapRegion;
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    37
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    38
// An evicting cache of cards that have been logged by the G1 post
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    39
// write barrier. Placing a card in the cache delays the refinement
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    40
// of the card until the card is evicted, or the cache is drained
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    41
// during the next evacuation pause.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    42
//
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    43
// The first thing the G1 post write barrier does is to check whether
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    44
// the card containing the updated pointer is already dirty and, if
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    45
// so, skips the remaining code in the barrier.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    46
//
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    47
// Delaying the refinement of a card will make the card fail the
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    48
// first is_dirty check in the write barrier, skipping the remainder
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    49
// of the write barrier.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    50
//
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    51
// This can significantly reduce the overhead of the write barrier
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    52
// code, increasing throughput.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    53
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    54
class G1HotCardCache: public CHeapObj<mtGC> {
54110
f4f0dce5d0bb 8220301: Remove jbyte use in CardTable
tschatzl
parents: 53747
diff changeset
    55
public:
f4f0dce5d0bb 8220301: Remove jbyte use in CardTable
tschatzl
parents: 53747
diff changeset
    56
  typedef CardTable::CardValue CardValue;
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    57
54110
f4f0dce5d0bb 8220301: Remove jbyte use in CardTable
tschatzl
parents: 53747
diff changeset
    58
private:
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    59
  G1CollectedHeap*  _g1h;
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    60
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    61
  bool              _use_cache;
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    62
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    63
  G1CardCounts      _card_counts;
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    64
29203
5024f7b3322c 8058446: G1 Hot card cache should use ArrayAllocator to allocate the cache array
tschatzl
parents: 28831
diff changeset
    65
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    66
  // The card cache table
54110
f4f0dce5d0bb 8220301: Remove jbyte use in CardTable
tschatzl
parents: 53747
diff changeset
    67
  CardValue** _hot_cache;
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    68
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    69
  size_t            _hot_cache_size;
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    70
46993
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 37057
diff changeset
    71
  size_t            _hot_cache_par_chunk_size;
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    72
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    73
  // Avoids false sharing when concurrently updating _hot_cache_idx or
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    74
  // _hot_cache_par_claimed_idx. These are never updated at the same time
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    75
  // thus it's not necessary to separate them as well
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    76
  char _pad_before[DEFAULT_CACHE_LINE_SIZE];
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    77
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    78
  volatile size_t _hot_cache_idx;
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    79
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    80
  volatile size_t _hot_cache_par_claimed_idx;
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    81
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
    82
  char _pad_after[DEFAULT_CACHE_LINE_SIZE];
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    83
59319
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
    84
  // Records whether insertion overflowed the hot card cache at least once. This
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
    85
  // avoids the need for a separate atomic counter of how many valid entries are
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
    86
  // in the HCC.
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
    87
  volatile bool _cache_wrapped_around;
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
    88
26830
e67193c2ceda 8053998: Hot card cache flush chunk size too coarse grained
mlarsson
parents: 26160
diff changeset
    89
  // The number of cached cards a thread claims when flushing the cache
e67193c2ceda 8053998: Hot card cache flush chunk size too coarse grained
mlarsson
parents: 26160
diff changeset
    90
  static const int ClaimChunkSize = 32;
e67193c2ceda 8053998: Hot card cache flush chunk size too coarse grained
mlarsson
parents: 26160
diff changeset
    91
33204
b8a3901ac5b3 8069330: Adjustment of concurrent refinement thresholds does not take hot card cache into account
tschatzl
parents: 30764
diff changeset
    92
 public:
b8a3901ac5b3 8069330: Adjustment of concurrent refinement thresholds does not take hot card cache into account
tschatzl
parents: 30764
diff changeset
    93
  static bool default_use_cache() {
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    94
    return (G1ConcRSLogCacheSize > 0);
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    95
  }
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    96
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    97
  G1HotCardCache(G1CollectedHeap* g1h);
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    98
  ~G1HotCardCache();
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
    99
26160
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 23855
diff changeset
   100
  void initialize(G1RegionToSpaceMapper* card_counts_storage);
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   101
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   102
  bool use_cache() { return _use_cache; }
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   103
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   104
  void set_use_cache(bool b) {
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   105
    _use_cache = (b ? default_use_cache() : false);
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   106
  }
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   107
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   108
  // Returns the card to be refined or NULL.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   109
  //
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   110
  // Increments the count for given the card. if the card is not 'hot',
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   111
  // it is returned for immediate refining. Otherwise the card is
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   112
  // added to the hot card cache.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   113
  // If there is enough room in the hot card cache for the card we're
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   114
  // adding, NULL is returned and no further action in needed.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   115
  // If we evict a card from the cache to make room for the new card,
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   116
  // the evicted card is then returned for refinement.
54110
f4f0dce5d0bb 8220301: Remove jbyte use in CardTable
tschatzl
parents: 53747
diff changeset
   117
  CardValue* insert(CardValue* card_ptr);
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   118
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   119
  // Refine the cards that have delayed as a result of
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   120
  // being in the cache.
58264
4e96939a5746 8231189: Rename worker_i parameters to worker_id
tschatzl
parents: 54982
diff changeset
   121
  void drain(G1CardTableEntryClosure* cl, uint worker_id);
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   122
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   123
  // Set up for parallel processing of the cards in the hot cache
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   124
  void reset_hot_cache_claimed_index() {
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   125
    _hot_cache_par_claimed_idx = 0;
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   126
  }
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   127
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   128
  // Resets the hot card cache and discards the entries.
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   129
  void reset_hot_cache() {
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   130
    assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
34633
2a6c7c7b30a7 8132510: Replace ThreadLocalStorage with compiler/language-based thread-local variables
dholmes
parents: 33204
diff changeset
   131
    assert(Thread::current()->is_VM_thread(), "Current thread should be the VMthread");
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   132
    if (default_use_cache()) {
59319
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
   133
      reset_hot_cache_internal();
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   134
    }
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   135
  }
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   136
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   137
  // Zeros the values in the card counts table for the given region
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   138
  void reset_card_counts(HeapRegion* hr);
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   139
59319
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
   140
  // Number of entries in the HCC.
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
   141
  size_t num_entries() const {
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
   142
    return _cache_wrapped_around ? _hot_cache_size : _hot_cache_idx + 1;
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
   143
  }
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   144
 private:
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   145
  void reset_hot_cache_internal() {
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   146
    assert(_hot_cache != NULL, "Logic");
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   147
    _hot_cache_idx = 0;
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   148
    for (size_t i = 0; i < _hot_cache_size; i++) {
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   149
      _hot_cache[i] = NULL;
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   150
    }
59319
9ee940f1de90 8227739: Merge cost predictions for scanning cards and log buffer entries
tschatzl
parents: 58264
diff changeset
   151
    _cache_wrapped_around = false;
28831
454224c7e3ba 8069273: Decrease Hot Card Cache Lock contention
redestad
parents: 26830
diff changeset
   152
  }
17327
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   153
};
4bd0581aa231 7176479: G1: JVM crashes on T5-8 system with 1.5 TB heap
johnc
parents:
diff changeset
   154
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 47885
diff changeset
   155
#endif // SHARE_GC_G1_G1HOTCARDCACHE_HPP