PING: Linux: Support transparent hugepages
Andrew Haley
aph at redhat.com
Mon Apr 4 06:18:04 PDT 2011
On 04/01/2011 08:01 PM, Igor Veresov wrote:
> On 4/1/11 11:38 AM, Andrew Haley wrote:
>> On 04/01/2011 07:24 PM, Igor Veresov wrote:
>>> Why is alignment required? Afaik it's perfectly fine to have mixed page
>>> sizes in a single segment.
>>
>> Alignment is the only way to guarantee that all pages are huge pages.
>
> Right, but my point was that +UseLargePages option would do that
> guaranteeing alignment.
>
>>
>>> Also, if use use +UseLargePages, all the heap and generation sizes
>>> will be largepage-alinged anyway. Also, some things like the
>>> NUMA-allocator will work better is they know kind of pages the
>>> underlying segment has.
>>
>> Yes, but on Linux at least +UseLargePages (using all that SHM stuff)
>> needs special permissions, so it tends not to be used as much as it
>> could.
>
> Right, but you can choose whether to do via SHM or by just doing madvise
> at runtime. This way your code will nicely fit into the existing
> framework - you'll get automatic page size detection and hence all the
> requests from the runtime for memory will come properly aligned.
>
>>
>>> What I would've done is put some logic to distinguish kernels that
>>> support transparent large pages and instead of using all the SHM
>>> stuff just use a mmap + madvise(MADV_HUGEPAGE).
I'm afraid I've been unable to find that work in http://hg.openjdk.java.net/jdk7/hotspot//hotspot
Is there some other tree that I should be looking at?
Andrew.
More information about the hotspot-dev
mailing list