Request for approval: 6929067: Stack guard pages should be removed when thread is detached

David Holmes David.Holmes at oracle.com
Mon Aug 16 15:57:44 PDT 2010


Andrew Haley said the following on 08/16/10 18:42:
> On 08/16/2010 03:46 AM, David Holmes wrote:
>> Looking further into this, isn't the only thread that can be affected by
>> this the main thread? So we could perform this only if
>> os::is_initial_thread() returns true?
> 
> I suppose we could, yes.  I wonder if it'd be a latent bug to assume
> that Java threads could never use growable mappings, though.  Doing
> this makes the system a bit less robust.

As I understand it neither LinuxThreads nor NPTL have used growable 
mappings for a very long time. Even if there were a reason to go back to 
this it would have to be done in a compatible way and so there would be 
time to "enhance" the VM to accommodate it.

> Do you really think that the cost of get_stack_bounds() is significant in
> the context of terminating a thread?

It can be. This has introduced a new bottleneck on the thread 
termination path and we're seeing that affect on certain systems (the 
details of which I can't go in to).

Cheers,
David Holmes

> Andrew.
> 
> 
>> David Holmes said the following on 08/16/10 11:43:
>>> Andrew, Coleen,
>>>
>>> Andrew Haley said the following on 03/12/10 19:44:
>>>> On 03/11/2010 09:06 PM, Coleen Phillimore wrote:
>>>>> I've added the test to the changeset and a script to run in our
>>>>> harness.
>>>>>
>>>>> Also in os_linux.cpp, I changed the SYS_gettid call to go through our
>>>>> os::Linux::gettid() because on at least one linux, syscall() returns a
>>>>> long int which gets a compilation warning with %d.
>>>>>
>>>>> open webrev at http://cr.openjdk.java.net/~coleenp/6929067/
>>>>> bug link at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6929067
>>>>>
>>>>> Andrew, please have a look since you're the contributor.
>>>> That's OK, but you don't need SYS_gettid.
>>>> Please look at
>>>> http://cr.openjdk.java.net/~aph/6929067-jdk7-webrev-4/hotspot.patch
>>>> I changed to "/proc/self/maps", as you requested.  I think this is
>>>> better.
>>> It looks like the use of /proc/self/maps can be a thread termination
>>> bottleneck. Is there a way to determine whether this functionality is
>>> needed for the current thread without actually reading the map file?
>>>
>>> Thanks,
>>> David Holmes
>>>
> 


More information about the hotspot-dev mailing list