RFR (M) 8005012: Add WB APIs to better support NMT testing

Christian Törnqvist christian.tornqvist at oracle.com
Fri Jan 11 04:38:56 PST 2013


> Ok. Of course this screams deadlock potential to me :)

I'm fairly certain it's safe :) Another thing to keep in mind is that this code is not something that would run in a normal situation. It's a test only API used by a few tests under controlled circumstances.

> I don't see memSnapshot in the new webrev - was this all new stuff that is now gone?

Yes, the only previous changes in memSnapshot was the call notify_all so in the new revision there are no changes to that file.

Thanks,
Christian

-----Original Message-----
From: David Holmes 
Sent: den 11 januari 2013 07:48
To: Christian Törnqvist
Cc: Zhengyu Gu; hotspot-runtime-dev at openjdk.java.net
Subject: Re: RFR (M) 8005012: Add WB APIs to better support NMT testing

On 10/01/2013 8:52 PM, Christian Törnqvist wrote:
> Hi David,
>
>> This method blocks while holding the query_lock - is that intended?
>
> Yes, this will prevent NMT from shutting down and freeing the data structures we're using.

Ok. Of course this screams deadlock potential to me :)

>> Aside: the MemSnapshot::wait method is troubling me. What are you 
>> waiting upon ie what state condition? The notification is done in the 
>> destructor but how can the destructor be called if someone is calling
>> wait() upon the object's lock ??? It means you are destroying an object that is still in use, including the lock that is being waited upon!!!
>
> This was obviously incorrect, thanks for catching this. I've removed 
> it and done some small other cleanups, a new webrev can be found at 
> http://cr.openjdk.java.net/~ehelin/8005012/webrev.01/

I don't see memSnapshot in the new webrev - was this all new stuff that is now gone?

David


> Thanks,
> Christian
>
> -----Original Message-----
> From: David Holmes
> Sent: den 19 december 2012 00:21
> To: Christian Törnqvist
> Cc: hotspot-runtime-dev at openjdk.java.net; Zhengyu Gu
> Subject: Re: RFR (M) 8005012: Add WB APIs to better support NMT 
> testing
>
> On 19/12/2012 12:10 AM, Christian Törnqvist wrote:
>> Hi everyone,
>>
>> This change is about adding three new WB APIs to better support NMT 
>> testing. The changes are:
>>
>> ·A Test memory type, used by WB API's NMTAllocTest and 
>> NMTFreeTestMemory
>>
>> ·Added a WaitForDataMerge WB API to be able to block until the 
>> current generation has been merged and is visible, most of this work 
>> was done by Zhengyu Gu.
>
> This method blocks while holding the query_lock - is that intended?
>
> Aside: the MemSnapshot::wait method is troubling me. What are you 
> waiting upon ie what state condition? The notification is done in the 
> destructor but how can the destructor be called if someone is calling
> wait() upon the object's lock ??? It means you are destroying an object that is still in use, including the lock that is being waited upon!!!
>
> David
> -----
>
>>
>> Webrev can be found at:
>>
>> http://cr.openjdk.java.net/~ehelin/8005012/webrev.00/
>>
>> Thanks,
>>
>> Christian
>>


More information about the hotspot-runtime-dev mailing list