RFR: 8344797: GenShen: Update and rename confusing method
Kelvin Nilsen
kdnilsen at openjdk.org
Fri Nov 22 00:46:30 UTC 2024
On Fri, 22 Nov 2024 00:41:26 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
>> A few riders here:
>> * [Remove vestigial debugging assertions](https://github.com/openjdk/shenandoah/commit/9062113458bd1909409967abb743e11982f351ab)
>> * [Log cancellation time at debug level](https://github.com/openjdk/shenandoah/commit/e3dd23efcb179bc61565d25f6b46f3690a50caa4)
>> * [Use try_set instead of set](https://github.com/openjdk/shenandoah/pull/550/commits/49cb66a0fa7d0d660f5b986eea9d71035c157310)
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 881:
>
>> 879: // update costs on slow path.
>> 880: monitoring_support()->notify_heap_changed();
>> 881: _heap_changed.try_set();
>
> I'm not sure I understand the significance of this change from .set() to .try_set().
Would a comment help explain why it is ok for set() to fail here?
> src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 274:
>
>> 272: if (_cancel_requested_time > 0) {
>> 273: double cancel_time = os::elapsedTime() - _cancel_requested_time;
>> 274: log_debug(gc)("GC cancellation took %.3fs", cancel_time);
>
> may not be significant, but would prefer to avoid os::elapsedTime() invocation if we're not logging debug.
maybe write the argument to log_debug() as os::elapsedTime() - _cancel_requested_time.
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/550#discussion_r1853125010
PR Review Comment: https://git.openjdk.org/shenandoah/pull/550#discussion_r1853125940
More information about the shenandoah-dev
mailing list