RFR: 8327097: GenShen: Align PLAB sizes down rather than up [v6]
Kelvin Nilsen
kdnilsen at openjdk.org
Fri Mar 22 18:35:47 UTC 2024
On Wed, 20 Mar 2024 23:38:30 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp line 52:
>>
>>> 50: // from alignment_in_words to determine padding required to next alignment point.
>>> 51:
>>> 52: HeapWord* aligned_obj = (HeapWord*) align_up(orig_top, alignment_in_bytes);
>>
>> I think this method's declaration `allocate_aligned(...)` in the `.hpp` uses `alignment_in_words` as the name of the second parm. Similarly the comment in the header. Those should be corrected too to say `alignment_in_bytes`.
>
> We do know that this is alignment must be a mutiple of HeapWordSize (as demonstrated by the integer division you do further above). I'd just assert for the sake of peace of mind from an API perspective that this is always so by:
>
> assert(is_aligned(alignment_in_bytes, HeapWordSize), "Expected heap word alignment");
Good catch. Correcting the name in the header and in comment. Adding the suggested assert.
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/401#discussion_r1536025440
More information about the shenandoah-dev
mailing list