[External] : RE: RFC: x86_64: Fixing the align() macro
Gibbons, Scott
scott.gibbons at intel.com
Tue Aug 24 15:07:38 UTC 2021
I don't think it's easy to ensure this level of alignment. How can we do allocation alignment such that the low-order 6 bits of the allocated address are identical?
For example, let's say our original buffer was allocated at 0xXXX20 (i.e., 32-byte aligned, but *not* 64-byte aligned). We then allocate a new buffer, whose address is 0xXXX80, which *is* 64-byte aligned (and also 32-byte aligned). This will throw off all 64-byte aligned buffers within the segment, displacing them all by 32 bytes when the copy is made from one to the other. In order to ensure proper alignment (without fixing up all offsets within the segment) we would need to allocate 32 additional bytes and do some complex bookkeeping to re-adjust the starting address of the segment.
Allocating all segment buffers with 64-byte alignment would be easier and less wasteful of memory.
Thanks,
--Scott Gibbons
Software Development Engineer, Runtime Engineering
DEVELOPER SOFTWARE ENGINEERING
Ph: 1-503-456-7756
Cell: 1-469-450-8390
2501 NE Century Blvd
Hillsboro, OR 97124
Intel Corporation | www.intel.com
-----Original Message-----
From: dean.long at oracle.com <dean.long at oracle.com>
Sent: Friday, August 20, 2021 5:52 PM
To: Gibbons, Scott <scott.gibbons at intel.com>; hotspot-dev at openjdk.java.net
Subject: Re: [External] : RE: RFC: x86_64: Fixing the align() macro
On 8/20/21 9:49 AM, Gibbons, Scott wrote:
> So if we copy one code buffer to another with different moduli of
> starting addresses
Sorry if I wasn't clear. The idea is to make sure the destination code buffer has the same alignment as the source. Any padding would be adding when the code buffer is allocated (which is why I said "allocation alignment"), not for individual instructions.
dl
More information about the hotspot-dev
mailing list