RFR (S): 8242036: G1 HeapRegionRemSet::_n_coarse_entries could be a bool
Albert Yang
albert.m.yang at oracle.com
Fri Jul 24 11:37:13 UTC 2020
I see.
Updated:
http://cr.openjdk.java.net/~lkorinth/albert/8242036/3/
I am not sure if this unconditional write will pollute the cacheline
though, since this variable is accessed concurrently.
On 2020-07-24 13:02, Kim Barrett wrote:
>> On Jul 24, 2020, at 6:59 AM, Albert Yang <albert.m.yang at oracle.com> wrote:
>>
>> I don't think calling `at_put` unconditionally is clearer, since `_coarse_map.at_put` needs be after `_coarse_map.reinitialize`, which only happens when `_has_coarse_entries` is false.
>>
>> Maybe I misunderstood what you meant.
> I meant drop the conditional on line 267 (see below):
>
>> On 2020-07-24 10:23, Kim Barrett wrote:
>>> src/hotspot/share/gc/g1/heapRegionRemSet.cpp
>>> 267 if (!_coarse_map.at(max_hrm_index)) {
>>> 268 _coarse_map.at_put(max_hrm_index, true);
>>> 269 }
>>>
>>> The old code conditionalized on !_course_map.at() to avoid
>>> incrementing _n_coarse_entries if the entry was already set. That's
>>> no longer needed. It seems like it might be clearer to just do the
>>> at_put unconditionally. If so, also change the comment on line 264 to
>>> say something like "Ensure the corresponding coarse bit is set."
More information about the hotspot-gc-dev
mailing list