<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 3/10/15 12:26 PM, Jon Masamitsu
wrote:<br>
</div>
<blockquote cite="mid:54FF1B4A.9020609@oracle.com" type="cite">8017462:
G1: guarantee fails with UseDynamicNumberOfGCThreads
<br>
<br>
<a class="moz-txt-link-freetext" href="https://bugs.openjdk.java.net/browse/JDK-8017462">https://bugs.openjdk.java.net/browse/JDK-8017462</a>
<br>
<br>
When fewer than the maximum number of threads was being used for
<br>
a parallel section, phase times for the threads that did not
execute and
<br>
averages for the phase were misleading. The fix passes the active
number of
<br>
GC threads to the G1 phase timers.
<br>
<br>
<a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~jmasa/8017462/webrev.00/">http://cr.openjdk.java.net/~jmasa/8017462/webrev.00/</a>
<br>
<br>
Tested with gc_test_suite.
<br>
</blockquote>
Hi Jon,<br>
<br>
Looks good to me.<br>
<br>
Just a question: In g1StringDedup.cpp:<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<pre> void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool allow_resize_and_rehash) {
assert(is_enabled(), "String deduplication not enabled");
<span class="removed">- G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();</span>
<span class="removed">- g1p->phase_times()->note_string_dedup_fixup_start();</span>
<span class="new">+ G1CollectedHeap* g1h = G1CollectedHeap::heap();</span>
<span class="new">+ G1CollectorPolicy* g1p = g1h->g1_policy();</span>
<span class="new">+ uint active_workers = g1h->workers()->active_workers();</span>
<span class="new">+ g1p->phase_times()->note_string_dedup_fixup_start(active_workers);</span>
double fixup_start = os::elapsedTime();
G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash);
<span class="removed">- G1CollectedHeap* g1h = G1CollectedHeap::heap();</span>
<span class="removed">- g1h->set_par_threads();</span>
<span class="new">+ g1h->set_par_threads(active_workers);
</span></pre>
<span class="new">You switched from not changing the number of
active workers "</span><span class="removed">set_par_threads()</span>"
to explicitly setting the <br>
number "<span class="new">g1h->set_par_threads(active_workers)</span>".
<br>
<br>
Do you expect to get a different number of active threads this way,
or are you just making the code clearer by<br>
making the count explicit? <br>
<br>
- Derek<br>
</body>
</html>