annotate src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp @ 10361:eda078b01c65

8015268: NPG: 2.5% regression in young GC times on CRM Sales Opty Summary: Split SystemDictionary and ClassLoaderDataGraph root processing to help load balancing. Reviewed-by: tschatzl, johnc
author stefank
date Mon, 27 May 2013 15:22:59 +0200
parents c2bf0120ee5d
children de6a9e811145
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
2426
1d1603768966 7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
trims
parents: 2177
diff changeset
2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
28 #include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
29 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
30 #include "gc_implementation/parallelScavenge/psTasks.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // Tasks for parallel compaction of the old generation
a61af66fc99e Initial load
duke
parents:
diff changeset
34 //
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // Tasks are created and enqueued on a task queue. The
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // tasks for parallel old collector for marking objects
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // are MarkFromRootsTask and ThreadRootsMarkingTask.
a61af66fc99e Initial load
duke
parents:
diff changeset
38 //
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // MarkFromRootsTask's are created
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // with a root group (e.g., jni_handles) and when the do_it()
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // method of a MarkFromRootsTask is executed, it starts marking
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // form it's root group.
a61af66fc99e Initial load
duke
parents:
diff changeset
43 //
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // ThreadRootsMarkingTask's are created for each Java thread. When
a61af66fc99e Initial load
duke
parents:
diff changeset
45 // the do_it() method of a ThreadRootsMarkingTask is executed, it
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // starts marking from the thread's roots.
a61af66fc99e Initial load
duke
parents:
diff changeset
47 //
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // The enqueuing of the MarkFromRootsTask and ThreadRootsMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // do little more than create the task and put it on a queue. The
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // queue is a GCTaskQueue and threads steal tasks from this GCTaskQueue.
a61af66fc99e Initial load
duke
parents:
diff changeset
51 //
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // In addition to the MarkFromRootsTask and ThreadRootsMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // tasks there are StealMarkingTask tasks. The StealMarkingTask's
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // steal a reference from the marking stack of another
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // thread and transitively marks the object of the reference
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // and internal references. After successfully stealing a reference
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // and marking it, the StealMarkingTask drains its marking stack
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // stack before attempting another steal.
a61af66fc99e Initial load
duke
parents:
diff changeset
59 //
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // ThreadRootsMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
61 //
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // This task marks from the roots of a single thread. This task
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // enables marking of thread roots in parallel.
a61af66fc99e Initial load
duke
parents:
diff changeset
64 //
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 class ParallelTaskTerminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 class ThreadRootsMarkingTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
69 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
70 JavaThread* _java_thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 VMThread* _vm_thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
73 ThreadRootsMarkingTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
74 ThreadRootsMarkingTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 char* name() { return (char *)"thread-roots-marking-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
79 };
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 //
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // MarkFromRootsTask
a61af66fc99e Initial load
duke
parents:
diff changeset
84 //
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // This task marks from all the roots to all live
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // objects.
a61af66fc99e Initial load
duke
parents:
diff changeset
87 //
a61af66fc99e Initial load
duke
parents:
diff changeset
88 //
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 class MarkFromRootsTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
91 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
92 enum RootType {
a61af66fc99e Initial load
duke
parents:
diff changeset
93 universe = 1,
a61af66fc99e Initial load
duke
parents:
diff changeset
94 jni_handles = 2,
a61af66fc99e Initial load
duke
parents:
diff changeset
95 threads = 3,
a61af66fc99e Initial load
duke
parents:
diff changeset
96 object_synchronizer = 4,
a61af66fc99e Initial load
duke
parents:
diff changeset
97 flat_profiler = 5,
a61af66fc99e Initial load
duke
parents:
diff changeset
98 management = 6,
a61af66fc99e Initial load
duke
parents:
diff changeset
99 jvmti = 7,
a61af66fc99e Initial load
duke
parents:
diff changeset
100 system_dictionary = 8,
10361
eda078b01c65 8015268: NPG: 2.5% regression in young GC times on CRM Sales Opty
stefank
parents: 3915
diff changeset
101 class_loader_data = 9,
eda078b01c65 8015268: NPG: 2.5% regression in young GC times on CRM Sales Opty
stefank
parents: 3915
diff changeset
102 code_cache = 10
0
a61af66fc99e Initial load
duke
parents:
diff changeset
103 };
a61af66fc99e Initial load
duke
parents:
diff changeset
104 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
105 RootType _root_type;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
107 MarkFromRootsTask(RootType value) : _root_type(value) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 char* name() { return (char *)"mark-from-roots-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
110
a61af66fc99e Initial load
duke
parents:
diff changeset
111 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
112 };
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 //
a61af66fc99e Initial load
duke
parents:
diff changeset
115 // RefProcTaskProxy
a61af66fc99e Initial load
duke
parents:
diff changeset
116 //
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // This task is used as a proxy to parallel reference processing tasks .
a61af66fc99e Initial load
duke
parents:
diff changeset
118 //
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 class RefProcTaskProxy : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 ProcessTask & _rp_task;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 uint _work_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
125 RefProcTaskProxy(ProcessTask & rp_task, uint work_id)
a61af66fc99e Initial load
duke
parents:
diff changeset
126 : _rp_task(rp_task),
a61af66fc99e Initial load
duke
parents:
diff changeset
127 _work_id(work_id)
a61af66fc99e Initial load
duke
parents:
diff changeset
128 { }
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
131 virtual char* name() { return (char *)"Process referents by policy in parallel"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
134 };
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 //
a61af66fc99e Initial load
duke
parents:
diff changeset
139 // RefEnqueueTaskProxy
a61af66fc99e Initial load
duke
parents:
diff changeset
140 //
a61af66fc99e Initial load
duke
parents:
diff changeset
141 // This task is used as a proxy to parallel reference processing tasks .
a61af66fc99e Initial load
duke
parents:
diff changeset
142 //
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 class RefEnqueueTaskProxy: public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
145 typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 EnqueueTask& _enq_task;
a61af66fc99e Initial load
duke
parents:
diff changeset
147 uint _work_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
150 RefEnqueueTaskProxy(EnqueueTask& enq_task, uint work_id)
a61af66fc99e Initial load
duke
parents:
diff changeset
151 : _enq_task(enq_task),
a61af66fc99e Initial load
duke
parents:
diff changeset
152 _work_id(work_id)
a61af66fc99e Initial load
duke
parents:
diff changeset
153 { }
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 virtual char* name() { return (char *)"Enqueue reference objects in parallel"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
156 virtual void do_it(GCTaskManager* manager, uint which)
a61af66fc99e Initial load
duke
parents:
diff changeset
157 {
a61af66fc99e Initial load
duke
parents:
diff changeset
158 _enq_task.work(_work_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
159 }
a61af66fc99e Initial load
duke
parents:
diff changeset
160 };
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 //
a61af66fc99e Initial load
duke
parents:
diff changeset
164 // RefProcTaskExecutor
a61af66fc99e Initial load
duke
parents:
diff changeset
165 //
a61af66fc99e Initial load
duke
parents:
diff changeset
166 // Task executor is an interface for the reference processor to run
a61af66fc99e Initial load
duke
parents:
diff changeset
167 // tasks using GCTaskManager.
a61af66fc99e Initial load
duke
parents:
diff changeset
168 //
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 class RefProcTaskExecutor: public AbstractRefProcTaskExecutor {
a61af66fc99e Initial load
duke
parents:
diff changeset
171 virtual void execute(ProcessTask& task);
a61af66fc99e Initial load
duke
parents:
diff changeset
172 virtual void execute(EnqueueTask& task);
a61af66fc99e Initial load
duke
parents:
diff changeset
173 };
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 //
a61af66fc99e Initial load
duke
parents:
diff changeset
177 // StealMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
178 //
a61af66fc99e Initial load
duke
parents:
diff changeset
179 // This task is used to distribute work to idle threads.
a61af66fc99e Initial load
duke
parents:
diff changeset
180 //
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 class StealMarkingTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
183 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
184 ParallelTaskTerminator* const _terminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
185 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
188 char* name() { return (char *)"steal-marking-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 StealMarkingTask(ParallelTaskTerminator* t);
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 ParallelTaskTerminator* terminator() { return _terminator; }
a61af66fc99e Initial load
duke
parents:
diff changeset
193
a61af66fc99e Initial load
duke
parents:
diff changeset
194 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
195 };
a61af66fc99e Initial load
duke
parents:
diff changeset
196
a61af66fc99e Initial load
duke
parents:
diff changeset
197 //
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
198 // StealRegionCompactionTask
0
a61af66fc99e Initial load
duke
parents:
diff changeset
199 //
a61af66fc99e Initial load
duke
parents:
diff changeset
200 // This task is used to distribute work to idle threads.
a61af66fc99e Initial load
duke
parents:
diff changeset
201 //
a61af66fc99e Initial load
duke
parents:
diff changeset
202
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
203 class StealRegionCompactionTask : public GCTask {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
204 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
205 ParallelTaskTerminator* const _terminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
206 public:
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
207 StealRegionCompactionTask(ParallelTaskTerminator* t);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
208
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
209 char* name() { return (char *)"steal-region-task"; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
210 ParallelTaskTerminator* terminator() { return _terminator; }
a61af66fc99e Initial load
duke
parents:
diff changeset
211
a61af66fc99e Initial load
duke
parents:
diff changeset
212 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
213 };
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 //
a61af66fc99e Initial load
duke
parents:
diff changeset
216 // UpdateDensePrefixTask
a61af66fc99e Initial load
duke
parents:
diff changeset
217 //
a61af66fc99e Initial load
duke
parents:
diff changeset
218 // This task is used to update the dense prefix
a61af66fc99e Initial load
duke
parents:
diff changeset
219 // of a space.
a61af66fc99e Initial load
duke
parents:
diff changeset
220 //
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222 class UpdateDensePrefixTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
224 PSParallelCompact::SpaceId _space_id;
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
225 size_t _region_index_start;
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
226 size_t _region_index_end;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
229 char* name() { return (char *)"update-dense_prefix-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 UpdateDensePrefixTask(PSParallelCompact::SpaceId space_id,
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
232 size_t region_index_start,
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
233 size_t region_index_end);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 };
a61af66fc99e Initial load
duke
parents:
diff changeset
237
a61af66fc99e Initial load
duke
parents:
diff changeset
238 //
a61af66fc99e Initial load
duke
parents:
diff changeset
239 // DrainStacksCompactionTask
a61af66fc99e Initial load
duke
parents:
diff changeset
240 //
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
241 // This task processes regions that have been added to the stacks of each
0
a61af66fc99e Initial load
duke
parents:
diff changeset
242 // compaction manager.
a61af66fc99e Initial load
duke
parents:
diff changeset
243 //
a61af66fc99e Initial load
duke
parents:
diff changeset
244 // Trying to use one draining thread does not work because there are no
a61af66fc99e Initial load
duke
parents:
diff changeset
245 // guarantees about which task will be picked up by which thread. For example,
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
246 // if thread A gets all the preloaded regions, thread A may not get a draining
0
a61af66fc99e Initial load
duke
parents:
diff changeset
247 // task (they may all be done by other threads).
a61af66fc99e Initial load
duke
parents:
diff changeset
248 //
a61af66fc99e Initial load
duke
parents:
diff changeset
249
a61af66fc99e Initial load
duke
parents:
diff changeset
250 class DrainStacksCompactionTask : public GCTask {
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
251 uint _stack_index;
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
252 uint stack_index() { return _stack_index; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
253 public:
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
254 DrainStacksCompactionTask(uint stack_index) : GCTask(),
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
255 _stack_index(stack_index) {};
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
256 char* name() { return (char *)"drain-region-task"; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
257 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
258 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
259
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
260 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP