src/hotspot/share/gc/g1/g1SATBMarkQueueSet.hpp
author kbarrett
Wed, 26 Jun 2019 13:18:38 -0400
changeset 55498 e64383344f14
parent 54006 a421bdf22394
child 58059 baa4dd528de0
permissions -rw-r--r--
8225255: Make SATB qset lock-free Summary: Refactor PtrQueueSet, use lock-free stack for SATB completed buffers Reviewed-by: tschatzl, shade
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51368
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
     1
/*
53149
259c36ef27df 8215731: Move forward class definitions out of globalDefinitions.hpp
coleenp
parents: 52726
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
51368
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
     4
 *
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
     8
 *
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    13
 * accompanied this code).
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    14
 *
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    18
 *
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    21
 * questions.
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    22
 *
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    23
 */
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 53149
diff changeset
    25
#ifndef SHARE_GC_G1_G1SATBMARKQUEUESET_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 53149
diff changeset
    26
#define SHARE_GC_G1_G1SATBMARKQUEUESET_HPP
51368
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    27
51441
2e91d927e00c 8154343: Make SATB related code available to other GCs
kbarrett
parents: 51401
diff changeset
    28
#include "gc/shared/satbMarkQueue.hpp"
51368
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    29
51393
cc8d309cd05a 8209345: Merge SATBMarkQueueFilter into SATBMarkQueueSet
kbarrett
parents: 51368
diff changeset
    30
class G1CollectedHeap;
53149
259c36ef27df 8215731: Move forward class definitions out of globalDefinitions.hpp
coleenp
parents: 52726
diff changeset
    31
class Monitor;
54006
a421bdf22394 8219613: Use NonJavaThread PtrQueues
kbarrett
parents: 53244
diff changeset
    32
class Thread;
51368
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    33
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    34
class G1SATBMarkQueueSet : public SATBMarkQueueSet {
51393
cc8d309cd05a 8209345: Merge SATBMarkQueueFilter into SATBMarkQueueSet
kbarrett
parents: 51368
diff changeset
    35
  G1CollectedHeap* _g1h;
cc8d309cd05a 8209345: Merge SATBMarkQueueFilter into SATBMarkQueueSet
kbarrett
parents: 51368
diff changeset
    36
51368
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    37
public:
51393
cc8d309cd05a 8209345: Merge SATBMarkQueueFilter into SATBMarkQueueSet
kbarrett
parents: 51368
diff changeset
    38
  G1SATBMarkQueueSet();
cc8d309cd05a 8209345: Merge SATBMarkQueueFilter into SATBMarkQueueSet
kbarrett
parents: 51368
diff changeset
    39
cc8d309cd05a 8209345: Merge SATBMarkQueueFilter into SATBMarkQueueSet
kbarrett
parents: 51368
diff changeset
    40
  void initialize(G1CollectedHeap* g1h,
52582
6df094be7f58 8213352: Separate BufferNode allocation from PtrQueueSet
kbarrett
parents: 51441
diff changeset
    41
                  BufferNode::Allocator* allocator,
52726
9cfa2e273b77 8214278: Cleanup process_completed_threshold and related state
kbarrett
parents: 52582
diff changeset
    42
                  size_t process_completed_buffers_threshold,
54006
a421bdf22394 8219613: Use NonJavaThread PtrQueues
kbarrett
parents: 53244
diff changeset
    43
                  uint buffer_enqueue_threshold_percentage);
51393
cc8d309cd05a 8209345: Merge SATBMarkQueueFilter into SATBMarkQueueSet
kbarrett
parents: 51368
diff changeset
    44
54006
a421bdf22394 8219613: Use NonJavaThread PtrQueues
kbarrett
parents: 53244
diff changeset
    45
  static void handle_zero_index_for_thread(Thread* t);
a421bdf22394 8219613: Use NonJavaThread PtrQueues
kbarrett
parents: 53244
diff changeset
    46
  virtual SATBMarkQueue& satb_queue_for_thread(Thread* const t) const;
51393
cc8d309cd05a 8209345: Merge SATBMarkQueueFilter into SATBMarkQueueSet
kbarrett
parents: 51368
diff changeset
    47
  virtual void filter(SATBMarkQueue* queue);
51368
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    48
};
adcb0bb3d1e9 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access
rkennke
parents:
diff changeset
    49
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 53149
diff changeset
    50
#endif // SHARE_GC_G1_G1SATBMARKQUEUESET_HPP