src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58059 baa4dd528de0
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     1
/*
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     4
 *
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     8
 *
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    13
 * accompanied this code).
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    14
 *
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    18
 *
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    21
 * questions.
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    22
 *
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    23
 */
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    24
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    25
#include "precompiled.hpp"
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    26
#include "gc/g1/g1RedirtyCardsQueue.hpp"
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    27
#include "runtime/atomic.hpp"
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    28
#include "utilities/debug.hpp"
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    29
#include "utilities/macros.hpp"
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    30
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    31
// G1RedirtyCardsQueueBase::LocalQSet
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    32
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    33
G1RedirtyCardsQueueBase::LocalQSet::LocalQSet(G1RedirtyCardsQueueSet* shared_qset) :
58059
baa4dd528de0 8221361: Eliminate two-phase initialization for PtrQueueSet classes
kbarrett
parents: 57890
diff changeset
    34
  PtrQueueSet(shared_qset->allocator()),
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    35
  _shared_qset(shared_qset),
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    36
  _buffers()
58059
baa4dd528de0 8221361: Eliminate two-phase initialization for PtrQueueSet classes
kbarrett
parents: 57890
diff changeset
    37
{}
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    38
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    39
G1RedirtyCardsQueueBase::LocalQSet::~LocalQSet() {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    40
  assert(_buffers._head == NULL, "unflushed qset");
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    41
  assert(_buffers._tail == NULL, "invariant");
57507
f6b30bd6804e 8227719: G1 Pending cards estimation too conservative in cost prediction
tschatzl
parents: 55752
diff changeset
    42
  assert(_buffers._entry_count == 0, "invariant");
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    43
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    44
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    45
void G1RedirtyCardsQueueBase::LocalQSet::enqueue_completed_buffer(BufferNode* node) {
57507
f6b30bd6804e 8227719: G1 Pending cards estimation too conservative in cost prediction
tschatzl
parents: 55752
diff changeset
    46
  _buffers._entry_count += buffer_size() - node->index();
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    47
  node->set_next(_buffers._head);
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    48
  _buffers._head = node;
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    49
  if (_buffers._tail == NULL) {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    50
    _buffers._tail = node;
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    51
  }
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    52
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    53
57890
6bb824c45df1 8230192: Rename G1RedirtyCardsBufferList to G1BufferNodeList
kbarrett
parents: 57785
diff changeset
    54
G1BufferNodeList G1RedirtyCardsQueueBase::LocalQSet::take_all_completed_buffers() {
6bb824c45df1 8230192: Rename G1RedirtyCardsBufferList to G1BufferNodeList
kbarrett
parents: 57785
diff changeset
    55
  G1BufferNodeList result = _buffers;
6bb824c45df1 8230192: Rename G1RedirtyCardsBufferList to G1BufferNodeList
kbarrett
parents: 57785
diff changeset
    56
  _buffers = G1BufferNodeList();
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    57
  return result;
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    58
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    59
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    60
void G1RedirtyCardsQueueBase::LocalQSet::flush() {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    61
  _shared_qset->merge_bufferlist(this);
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    62
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    63
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    64
// G1RedirtyCardsQueue
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    65
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    66
G1RedirtyCardsQueue::G1RedirtyCardsQueue(G1RedirtyCardsQueueSet* qset) :
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    67
  G1RedirtyCardsQueueBase(qset), // Init _local_qset before passing to PtrQueue.
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    68
  PtrQueue(&_local_qset, true /* active (always) */)
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    69
{}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    70
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    71
G1RedirtyCardsQueue::~G1RedirtyCardsQueue() {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    72
  flush();
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    73
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    74
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    75
void G1RedirtyCardsQueue::handle_completed_buffer() {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    76
  enqueue_completed_buffer();
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    77
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    78
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    79
void G1RedirtyCardsQueue::flush() {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    80
  flush_impl();
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    81
  _local_qset.flush();
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    82
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    83
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    84
// G1RedirtyCardsQueueSet
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    85
57785
8d9362f3b8aa 8229044: G1RedirtyCardsQueueSet should be local to a collection
kbarrett
parents: 57507
diff changeset
    86
G1RedirtyCardsQueueSet::G1RedirtyCardsQueueSet(BufferNode::Allocator* allocator) :
58059
baa4dd528de0 8221361: Eliminate two-phase initialization for PtrQueueSet classes
kbarrett
parents: 57890
diff changeset
    87
  PtrQueueSet(allocator),
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    88
  _list(),
57507
f6b30bd6804e 8227719: G1 Pending cards estimation too conservative in cost prediction
tschatzl
parents: 55752
diff changeset
    89
  _entry_count(0),
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    90
  _tail(NULL)
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    91
  DEBUG_ONLY(COMMA _collecting(true))
58059
baa4dd528de0 8221361: Eliminate two-phase initialization for PtrQueueSet classes
kbarrett
parents: 57890
diff changeset
    92
{}
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    93
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    94
G1RedirtyCardsQueueSet::~G1RedirtyCardsQueueSet() {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    95
  verify_empty();
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    96
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    97
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    98
#ifdef ASSERT
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
    99
void G1RedirtyCardsQueueSet::verify_empty() const {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   100
  assert(_list.empty(), "precondition");
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   101
  assert(_tail == NULL, "invariant");
57507
f6b30bd6804e 8227719: G1 Pending cards estimation too conservative in cost prediction
tschatzl
parents: 55752
diff changeset
   102
  assert(_entry_count == 0, "invariant");
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   103
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   104
#endif // ASSERT
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   105
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   106
BufferNode* G1RedirtyCardsQueueSet::all_completed_buffers() const {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   107
  DEBUG_ONLY(_collecting = false;)
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   108
  return _list.top();
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   109
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   110
57890
6bb824c45df1 8230192: Rename G1RedirtyCardsBufferList to G1BufferNodeList
kbarrett
parents: 57785
diff changeset
   111
G1BufferNodeList G1RedirtyCardsQueueSet::take_all_completed_buffers() {
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   112
  DEBUG_ONLY(_collecting = false;)
57890
6bb824c45df1 8230192: Rename G1RedirtyCardsBufferList to G1BufferNodeList
kbarrett
parents: 57785
diff changeset
   113
  G1BufferNodeList result(_list.pop_all(), _tail, _entry_count);
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   114
  _tail = NULL;
57507
f6b30bd6804e 8227719: G1 Pending cards estimation too conservative in cost prediction
tschatzl
parents: 55752
diff changeset
   115
  _entry_count = 0;
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   116
  DEBUG_ONLY(_collecting = true;)
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   117
  return result;
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   118
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   119
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   120
void G1RedirtyCardsQueueSet::update_tail(BufferNode* node) {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   121
  // Node is the tail of a (possibly single element) list just prepended to
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   122
  // _list.  If, after that prepend, node's follower is NULL, then node is
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   123
  // also the tail of _list, so record it as such.
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   124
  if (node->next() == NULL) {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   125
    assert(_tail == NULL, "invariant");
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   126
    _tail = node;
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   127
  }
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   128
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   129
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   130
void G1RedirtyCardsQueueSet::enqueue_completed_buffer(BufferNode* node) {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   131
  assert(_collecting, "precondition");
57507
f6b30bd6804e 8227719: G1 Pending cards estimation too conservative in cost prediction
tschatzl
parents: 55752
diff changeset
   132
  Atomic::add(buffer_size() - node->index(), &_entry_count);
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   133
  _list.push(*node);
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   134
  update_tail(node);
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   135
}
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   136
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   137
void G1RedirtyCardsQueueSet::merge_bufferlist(LocalQSet* src) {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   138
  assert(_collecting, "precondition");
57890
6bb824c45df1 8230192: Rename G1RedirtyCardsBufferList to G1BufferNodeList
kbarrett
parents: 57785
diff changeset
   139
  const G1BufferNodeList from = src->take_all_completed_buffers();
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   140
  if (from._head != NULL) {
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   141
    assert(from._tail != NULL, "invariant");
57507
f6b30bd6804e 8227719: G1 Pending cards estimation too conservative in cost prediction
tschatzl
parents: 55752
diff changeset
   142
    Atomic::add(from._entry_count, &_entry_count);
55752
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   143
    _list.prepend(*from._head, *from._tail);
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   144
    update_tail(from._tail);
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   145
  }
8ae33203d600 8162929: Enqueuing dirty cards into a single DCQS during GC does not scale
kbarrett
parents:
diff changeset
   146
}