RR(S): 8009062 poor performance of JNI AttachCurrentThread after fix for 7017193

Adam Domurad adomurad at redhat.com
Thu Aug 22 11:13:16 PDT 2013


On 08/20/2013 02:30 PM, Dmitry Samersoff wrote:
> Hi Everybody,
>
> Here is webrev of changes I'm about to integrate:
>
> http://cr.openjdk.java.net/~dsamersoff/8009062/webrev.13/
>
> The problem:
>
> Under Linux stack of main thread is growable, so we have to make sure
> that address we plan to put a guard pages to and below is not mapped.
>
> Historically we find bounds of the stack of main thread by seeking
> /proc/self/maps for "[stack]" and parsing this line.
>
> But after intensive testing we figured out that it's not required to
> re-read stack bounds after create_attached_thread() because we are
> manually grow stack up to the bounds in create_attached_thread()
>
>
> Solution:
>
> I use mincore(2) to check whether
> the page is mapped or not. Typically mincore(2) is used to check whether
> the page is resides in physical memory or not, but this function returns
> -1 and set errno to ENOMEM if a region we are asking about contains not
> mapped memory.
>
> Testing:
>
> Passed jprt, jck and and couple of ute tests. Wrote special regression test.
>
> -Dmitry
>

It checks out from my end. Thanks for sticking with it!
-Adam


More information about the hotspot-dev mailing list