author | jcoomes |
Wed, 03 Mar 2010 14:48:26 -0800 | |
changeset 5076 | 8b74a4b60b31 |
parent 3262 | 30d1c247fc25 |
child 5547 | f4b087cbb361 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
2105 | 2 |
* Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
20 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
21 |
* have any questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
# include "incls/_precompiled.incl" |
|
26 |
# include "incls/_taskqueue.cpp.incl" |
|
27 |
||
2010
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
28 |
#ifdef TRACESPINNING |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
29 |
uint ParallelTaskTerminator::_total_yields = 0; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
30 |
uint ParallelTaskTerminator::_total_spins = 0; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
31 |
uint ParallelTaskTerminator::_total_peeks = 0; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
32 |
#endif |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
33 |
|
1 | 34 |
int TaskQueueSetSuper::randomParkAndMiller(int *seed0) { |
35 |
const int a = 16807; |
|
36 |
const int m = 2147483647; |
|
37 |
const int q = 127773; /* m div a */ |
|
38 |
const int r = 2836; /* m mod a */ |
|
39 |
assert(sizeof(int) == 4, "I think this relies on that"); |
|
40 |
int seed = *seed0; |
|
41 |
int hi = seed / q; |
|
42 |
int lo = seed % q; |
|
43 |
int test = a * lo - r * hi; |
|
44 |
if (test > 0) |
|
45 |
seed = test; |
|
46 |
else |
|
47 |
seed = test + m; |
|
48 |
*seed0 = seed; |
|
49 |
return seed; |
|
50 |
} |
|
51 |
||
52 |
ParallelTaskTerminator:: |
|
53 |
ParallelTaskTerminator(int n_threads, TaskQueueSetSuper* queue_set) : |
|
54 |
_n_threads(n_threads), |
|
55 |
_queue_set(queue_set), |
|
56 |
_offered_termination(0) {} |
|
57 |
||
58 |
bool ParallelTaskTerminator::peek_in_queue_set() { |
|
59 |
return _queue_set->peek(); |
|
60 |
} |
|
61 |
||
62 |
void ParallelTaskTerminator::yield() { |
|
3262
30d1c247fc25
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
2105
diff
changeset
|
63 |
assert(_offered_termination <= _n_threads, "Invariant"); |
1 | 64 |
os::yield(); |
65 |
} |
|
66 |
||
67 |
void ParallelTaskTerminator::sleep(uint millis) { |
|
3262
30d1c247fc25
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
2105
diff
changeset
|
68 |
assert(_offered_termination <= _n_threads, "Invariant"); |
1 | 69 |
os::sleep(Thread::current(), millis, false); |
70 |
} |
|
71 |
||
1374 | 72 |
bool |
73 |
ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { |
|
3262
30d1c247fc25
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
2105
diff
changeset
|
74 |
assert(_offered_termination < _n_threads, "Invariant"); |
1 | 75 |
Atomic::inc(&_offered_termination); |
76 |
||
2005
42075507972b
6787254: Work queue capacity can be increased substantially on some platforms
ysr
parents:
1623
diff
changeset
|
77 |
uint yield_count = 0; |
2010
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
78 |
// Number of hard spin loops done since last yield |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
79 |
uint hard_spin_count = 0; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
80 |
// Number of iterations in the hard spin loop. |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
81 |
uint hard_spin_limit = WorkStealingHardSpins; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
82 |
|
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
83 |
// If WorkStealingSpinToYieldRatio is 0, no hard spinning is done. |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
84 |
// If it is greater than 0, then start with a small number |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
85 |
// of spins and increase number with each turn at spinning until |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
86 |
// the count of hard spins exceeds WorkStealingSpinToYieldRatio. |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
87 |
// Then do a yield() call and start spinning afresh. |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
88 |
if (WorkStealingSpinToYieldRatio > 0) { |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
89 |
hard_spin_limit = WorkStealingHardSpins >> WorkStealingSpinToYieldRatio; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
90 |
hard_spin_limit = MAX2(hard_spin_limit, 1U); |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
91 |
} |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
92 |
// Remember the initial spin limit. |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
93 |
uint hard_spin_start = hard_spin_limit; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
94 |
|
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
95 |
// Loop waiting for all threads to offer termination or |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
96 |
// more work. |
1 | 97 |
while (true) { |
3262
30d1c247fc25
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
2105
diff
changeset
|
98 |
assert(_offered_termination <= _n_threads, "Invariant"); |
2010
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
99 |
// Are all threads offering termination? |
1 | 100 |
if (_offered_termination == _n_threads) { |
101 |
return true; |
|
102 |
} else { |
|
2010
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
103 |
// Look for more work. |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
104 |
// Periodically sleep() instead of yield() to give threads |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
105 |
// waiting on the cores the chance to grab this code |
1 | 106 |
if (yield_count <= WorkStealingYieldsBeforeSleep) { |
2010
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
107 |
// Do a yield or hardspin. For purposes of deciding whether |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
108 |
// to sleep, count this as a yield. |
1 | 109 |
yield_count++; |
2010
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
110 |
|
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
111 |
// Periodically call yield() instead spinning |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
112 |
// After WorkStealingSpinToYieldRatio spins, do a yield() call |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
113 |
// and reset the counts and starting limit. |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
114 |
if (hard_spin_count > WorkStealingSpinToYieldRatio) { |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
115 |
yield(); |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
116 |
hard_spin_count = 0; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
117 |
hard_spin_limit = hard_spin_start; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
118 |
#ifdef TRACESPINNING |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
119 |
_total_yields++; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
120 |
#endif |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
121 |
} else { |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
122 |
// Hard spin this time |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
123 |
// Increase the hard spinning period but only up to a limit. |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
124 |
hard_spin_limit = MIN2(2*hard_spin_limit, |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
125 |
(uint) WorkStealingHardSpins); |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
126 |
for (uint j = 0; j < hard_spin_limit; j++) { |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
127 |
SpinPause(); |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
128 |
} |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
129 |
hard_spin_count++; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
130 |
#ifdef TRACESPINNING |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
131 |
_total_spins++; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
132 |
#endif |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
133 |
} |
1 | 134 |
} else { |
135 |
if (PrintGCDetails && Verbose) { |
|
136 |
gclog_or_tty->print_cr("ParallelTaskTerminator::offer_termination() " |
|
137 |
"thread %d sleeps after %d yields", |
|
138 |
Thread::current(), yield_count); |
|
139 |
} |
|
140 |
yield_count = 0; |
|
141 |
// A sleep will cause this processor to seek work on another processor's |
|
142 |
// runqueue, if it has nothing else to run (as opposed to the yield |
|
143 |
// which may only move the thread to the end of the this processor's |
|
144 |
// runqueue). |
|
145 |
sleep(WorkStealingSleepMillis); |
|
146 |
} |
|
147 |
||
2010
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
148 |
#ifdef TRACESPINNING |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
149 |
_total_peeks++; |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
150 |
#endif |
1374 | 151 |
if (peek_in_queue_set() || |
152 |
(terminator != NULL && terminator->should_exit_termination())) { |
|
1 | 153 |
Atomic::dec(&_offered_termination); |
3262
30d1c247fc25
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
2105
diff
changeset
|
154 |
assert(_offered_termination < _n_threads, "Invariant"); |
1 | 155 |
return false; |
156 |
} |
|
157 |
} |
|
158 |
} |
|
159 |
} |
|
160 |
||
2010
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
161 |
#ifdef TRACESPINNING |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
162 |
void ParallelTaskTerminator::print_termination_counts() { |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
163 |
gclog_or_tty->print_cr("ParallelTaskTerminator Total yields: %lld " |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
164 |
"Total spins: %lld Total peeks: %lld", |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
165 |
total_yields(), |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
166 |
total_spins(), |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
167 |
total_peeks()); |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
168 |
} |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
169 |
#endif |
c13462bbad17
6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents:
2005
diff
changeset
|
170 |
|
1 | 171 |
void ParallelTaskTerminator::reset_for_reuse() { |
172 |
if (_offered_termination != 0) { |
|
173 |
assert(_offered_termination == _n_threads, |
|
174 |
"Terminator may still be in use"); |
|
175 |
_offered_termination = 0; |
|
176 |
} |
|
177 |
} |
|
178 |
||
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3262
diff
changeset
|
179 |
#ifdef ASSERT |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3262
diff
changeset
|
180 |
bool ObjArrayTask::is_valid() const { |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3262
diff
changeset
|
181 |
return _obj != NULL && _obj->is_objArray() && _index > 0 && |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3262
diff
changeset
|
182 |
_index < objArrayOop(_obj)->length(); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3262
diff
changeset
|
183 |
} |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3262
diff
changeset
|
184 |
#endif // ASSERT |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3262
diff
changeset
|
185 |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
186 |
bool RegionTaskQueueWithOverflow::is_empty() { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
187 |
return (_region_queue.size() == 0) && |
1 | 188 |
(_overflow_stack->length() == 0); |
189 |
} |
|
190 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
191 |
bool RegionTaskQueueWithOverflow::stealable_is_empty() { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
192 |
return _region_queue.size() == 0; |
1 | 193 |
} |
194 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
195 |
bool RegionTaskQueueWithOverflow::overflow_is_empty() { |
1 | 196 |
return _overflow_stack->length() == 0; |
197 |
} |
|
198 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
199 |
void RegionTaskQueueWithOverflow::initialize() { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
200 |
_region_queue.initialize(); |
1 | 201 |
assert(_overflow_stack == 0, "Creating memory leak"); |
202 |
_overflow_stack = |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
203 |
new (ResourceObj::C_HEAP) GrowableArray<RegionTask>(10, true); |
1 | 204 |
} |
205 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
206 |
void RegionTaskQueueWithOverflow::save(RegionTask t) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
207 |
if (TraceRegionTasksQueuing && Verbose) { |
1 | 208 |
gclog_or_tty->print_cr("CTQ: save " PTR_FORMAT, t); |
209 |
} |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
210 |
if(!_region_queue.push(t)) { |
1 | 211 |
_overflow_stack->push(t); |
212 |
} |
|
213 |
} |
|
214 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
215 |
// Note that using this method will retrieve all regions |
1 | 216 |
// that have been saved but that it will always check |
217 |
// the overflow stack. It may be more efficient to |
|
218 |
// check the stealable queue and the overflow stack |
|
219 |
// separately. |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
220 |
bool RegionTaskQueueWithOverflow::retrieve(RegionTask& region_task) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
221 |
bool result = retrieve_from_overflow(region_task); |
1 | 222 |
if (!result) { |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
223 |
result = retrieve_from_stealable_queue(region_task); |
1 | 224 |
} |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
225 |
if (TraceRegionTasksQueuing && Verbose && result) { |
1 | 226 |
gclog_or_tty->print_cr(" CTQ: retrieve " PTR_FORMAT, result); |
227 |
} |
|
228 |
return result; |
|
229 |
} |
|
230 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
231 |
bool RegionTaskQueueWithOverflow::retrieve_from_stealable_queue( |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
232 |
RegionTask& region_task) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
233 |
bool result = _region_queue.pop_local(region_task); |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
234 |
if (TraceRegionTasksQueuing && Verbose) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
235 |
gclog_or_tty->print_cr("CTQ: retrieve_stealable " PTR_FORMAT, region_task); |
1 | 236 |
} |
237 |
return result; |
|
238 |
} |
|
239 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
240 |
bool |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
241 |
RegionTaskQueueWithOverflow::retrieve_from_overflow(RegionTask& region_task) { |
1 | 242 |
bool result; |
243 |
if (!_overflow_stack->is_empty()) { |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
244 |
region_task = _overflow_stack->pop(); |
1 | 245 |
result = true; |
246 |
} else { |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
247 |
region_task = (RegionTask) NULL; |
1 | 248 |
result = false; |
249 |
} |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
250 |
if (TraceRegionTasksQueuing && Verbose) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1374
diff
changeset
|
251 |
gclog_or_tty->print_cr("CTQ: retrieve_stealable " PTR_FORMAT, region_task); |
1 | 252 |
} |
253 |
return result; |
|
254 |
} |