PING: Linux: Support transparent hugepages

Igor Veresov igor.veresov at oracle.com
Mon Apr 4 09:43:41 PDT 2011


On 4/4/11 6:18 AM, Andrew Haley wrote:
> 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?

I didn't mean the work I mentioned in the last paragraph that you quoted 
exists, I rather meant that it should be done in order to implement 
proper transparent pages support in linux (because we want the older 
linux kernels work too).

I think it should be analogous to the Solaris implementation, which can 
be found here: 
http://hg.openjdk.java.net/jdk7/hotspot/hotspot/file/2dbcb4a4d8da/src/os/solaris/vm/os_solaris.cpp 


igor

>
> Andrew.



More information about the hotspot-dev mailing list