RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Doerr, Martin
Hi,

unfortunately, the safepoint mechanism initialization on AIX is not completely correct, yet. The VM crashes when using -XX:-OptimizePollingPageLocation or when allocation at desired addresses failed.
Only pages allocated by mmap can be read protected.

In addition, SIGTRAP-based polling performs slightly better on PPC64 and avoids the need for allocating a protected page.

I have uploaded a webrev:
http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.00/

We use trap instructions if UseSIGTRAP is enabled (PPC64 specific -XX flag) and fall back to loads from the polling pages otherwise.

Please review.

I will also need a sponsor because I'm changing the shared file safepointMechanism.cpp. It's not a functional change for other platforms.

Best regards,
Martin

Reply | Threaded
Open this post in threaded view
|

Re: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Robbin Ehn
Hi Martin,

Looks fine!

/Robbin

On 2017-12-28 18:47, Doerr, Martin wrote:

> Hi,
>
> unfortunately, the safepoint mechanism initialization on AIX is not completely correct, yet. The VM crashes when using -XX:-OptimizePollingPageLocation or when allocation at desired addresses failed.
>
> Only pages allocated by mmap can be read protected.
>
> In addition, SIGTRAP-based polling performs slightly better on PPC64 and avoids the need for allocating a protected page.
>
> I have uploaded a webrev:
>
> http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.00/
>
> We use trap instructions if UseSIGTRAP is enabled (PPC64 specific -XX flag) and fall back to loads from the polling pages otherwise.
>
> Please review.
>
> I will also need a sponsor because I’m changing the shared file safepointMechanism.cpp. It’s not a functional change for other platforms.
>
> Best regards,
>
> Martin
>
Reply | Threaded
Open this post in threaded view
|

RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Lindenmaier, Goetz
In reply to this post by Doerr, Martin
Hi Martin,

thanks for fixing this issue. The change itself looks good.

Nevertheless some points:
I would like a comment about the sigtrap mechanism used on
ppc, maybe where the macro for UseSIGTRAP is set.

I think you need to adapt runtime/logging/OsCpuLoggingTest.java.
The tracing is missing on linuxppc, too, if UseSIGTRAP is set.
Maybe the test should call the VM with -XX:-UseSIGTRAP on ppc?
And then it should work on aix, too?

Best regards,
  Goetz.

> -----Original Message-----
> From: Doerr, Martin
> Sent: Donnerstag, 28. Dezember 2017 18:47
> To: [hidden email]; Robbin Ehn
> <[hidden email]>; Lindenmaier, Goetz <[hidden email]>
> Subject: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX
> and support SIGTRAP
>
> Hi,
>
>
>
> unfortunately, the safepoint mechanism initialization on AIX is not completely
> correct, yet. The VM crashes when using -XX:-OptimizePollingPageLocation or
> when allocation at desired addresses failed.
>
> Only pages allocated by mmap can be read protected.
>
>
>
> In addition, SIGTRAP-based polling performs slightly better on PPC64 and avoids
> the need for allocating a protected page.
>
>
>
> I have uploaded a webrev:
>
> http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.00/
>
>
>
> We use trap instructions if UseSIGTRAP is enabled (PPC64 specific -XX flag) and
> fall back to loads from the polling pages otherwise.
>
>
>
> Please review.
>
>
>
> I will also need a sponsor because I'm changing the shared file
> safepointMechanism.cpp. It's not a functional change for other platforms.
>
>
>
> Best regards,
>
> Martin
>
>

Reply | Threaded
Open this post in threaded view
|

RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Doerr, Martin
Hi Robbin and Götz,

thanks for reviewing.

I have added a comment, improved safepointMechanism_aix.cpp, adapted the test OsCpuLoggingTest and added reviewer information.

New webrev is here:
http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.01/

Please take a look.

The change applies to jdk10 (as well as to jdk/hs, but it's targeted to 10). Can somebody sponsor, please?

Thanks and best regards,
Martin


-----Original Message-----
From: Lindenmaier, Goetz
Sent: Samstag, 30. Dezember 2017 14:01
To: Doerr, Martin <[hidden email]>; [hidden email]; Robbin Ehn <[hidden email]>
Subject: RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Hi Martin,

thanks for fixing this issue. The change itself looks good.

Nevertheless some points:
I would like a comment about the sigtrap mechanism used on
ppc, maybe where the macro for UseSIGTRAP is set.

I think you need to adapt runtime/logging/OsCpuLoggingTest.java.
The tracing is missing on linuxppc, too, if UseSIGTRAP is set.
Maybe the test should call the VM with -XX:-UseSIGTRAP on ppc?
And then it should work on aix, too?

Best regards,
  Goetz.

> -----Original Message-----
> From: Doerr, Martin
> Sent: Donnerstag, 28. Dezember 2017 18:47
> To: [hidden email]; Robbin Ehn
> <[hidden email]>; Lindenmaier, Goetz <[hidden email]>
> Subject: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX
> and support SIGTRAP
>
> Hi,
>
>
>
> unfortunately, the safepoint mechanism initialization on AIX is not completely
> correct, yet. The VM crashes when using -XX:-OptimizePollingPageLocation or
> when allocation at desired addresses failed.
>
> Only pages allocated by mmap can be read protected.
>
>
>
> In addition, SIGTRAP-based polling performs slightly better on PPC64 and avoids
> the need for allocating a protected page.
>
>
>
> I have uploaded a webrev:
>
> http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.00/
>
>
>
> We use trap instructions if UseSIGTRAP is enabled (PPC64 specific -XX flag) and
> fall back to loads from the polling pages otherwise.
>
>
>
> Please review.
>
>
>
> I will also need a sponsor because I'm changing the shared file
> safepointMechanism.cpp. It's not a functional change for other platforms.
>
>
>
> Best regards,
>
> Martin
>
>

Reply | Threaded
Open this post in threaded view
|

RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Lindenmaier, Goetz
Hi Martin,

thanks for the fixes.  Good that now also aix ist tested.

Best regards,
  Goetz.

> -----Original Message-----
> From: Doerr, Martin
> Sent: Dienstag, 2. Januar 2018 17:36
> To: Lindenmaier, Goetz <[hidden email]>; hotspot-runtime-
> [hidden email]; Robbin Ehn <[hidden email]>
> Subject: RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization
> on AIX and support SIGTRAP
>
> Hi Robbin and Götz,
>
> thanks for reviewing.
>
> I have added a comment, improved safepointMechanism_aix.cpp, adapted
> the test OsCpuLoggingTest and added reviewer information.
>
> New webrev is here:
> http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.01/
>
> Please take a look.
>
> The change applies to jdk10 (as well as to jdk/hs, but it's targeted to 10). Can
> somebody sponsor, please?
>
> Thanks and best regards,
> Martin
>
>
> -----Original Message-----
> From: Lindenmaier, Goetz
> Sent: Samstag, 30. Dezember 2017 14:01
> To: Doerr, Martin <[hidden email]>; hotspot-runtime-
> [hidden email]; Robbin Ehn <[hidden email]>
> Subject: RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization
> on AIX and support SIGTRAP
>
> Hi Martin,
>
> thanks for fixing this issue. The change itself looks good.
>
> Nevertheless some points:
> I would like a comment about the sigtrap mechanism used on
> ppc, maybe where the macro for UseSIGTRAP is set.
>
> I think you need to adapt runtime/logging/OsCpuLoggingTest.java.
> The tracing is missing on linuxppc, too, if UseSIGTRAP is set.
> Maybe the test should call the VM with -XX:-UseSIGTRAP on ppc?
> And then it should work on aix, too?
>
> Best regards,
>   Goetz.
>
> > -----Original Message-----
> > From: Doerr, Martin
> > Sent: Donnerstag, 28. Dezember 2017 18:47
> > To: [hidden email]; Robbin Ehn
> > <[hidden email]>; Lindenmaier, Goetz
> <[hidden email]>
> > Subject: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on
> AIX
> > and support SIGTRAP
> >
> > Hi,
> >
> >
> >
> > unfortunately, the safepoint mechanism initialization on AIX is not
> completely
> > correct, yet. The VM crashes when using -XX:-OptimizePollingPageLocation
> or
> > when allocation at desired addresses failed.
> >
> > Only pages allocated by mmap can be read protected.
> >
> >
> >
> > In addition, SIGTRAP-based polling performs slightly better on PPC64 and
> avoids
> > the need for allocating a protected page.
> >
> >
> >
> > I have uploaded a webrev:
> >
> > http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.00/
> >
> >
> >
> > We use trap instructions if UseSIGTRAP is enabled (PPC64 specific -XX flag)
> and
> > fall back to loads from the polling pages otherwise.
> >
> >
> >
> > Please review.
> >
> >
> >
> > I will also need a sponsor because I'm changing the shared file
> > safepointMechanism.cpp. It's not a functional change for other platforms.
> >
> >
> >
> > Best regards,
> >
> > Martin
> >
> >

Reply | Threaded
Open this post in threaded view
|

Re: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Robbin Ehn
In reply to this post by Doerr, Martin
Hi Martin,

I tested it with no problem so I'll push it now.

/Robbin

On 01/02/2018 05:35 PM, Doerr, Martin wrote:

> Hi Robbin and Götz,
>
> thanks for reviewing.
>
> I have added a comment, improved safepointMechanism_aix.cpp, adapted the test OsCpuLoggingTest and added reviewer information.
>
> New webrev is here:
> http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.01/
>
> Please take a look.
>
> The change applies to jdk10 (as well as to jdk/hs, but it's targeted to 10). Can somebody sponsor, please?
>
> Thanks and best regards,
> Martin
>
>
> -----Original Message-----
> From: Lindenmaier, Goetz
> Sent: Samstag, 30. Dezember 2017 14:01
> To: Doerr, Martin <[hidden email]>; [hidden email]; Robbin Ehn <[hidden email]>
> Subject: RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP
>
> Hi Martin,
>
> thanks for fixing this issue. The change itself looks good.
>
> Nevertheless some points:
> I would like a comment about the sigtrap mechanism used on
> ppc, maybe where the macro for UseSIGTRAP is set.
>
> I think you need to adapt runtime/logging/OsCpuLoggingTest.java.
> The tracing is missing on linuxppc, too, if UseSIGTRAP is set.
> Maybe the test should call the VM with -XX:-UseSIGTRAP on ppc?
> And then it should work on aix, too?
>
> Best regards,
>    Goetz.
>
>> -----Original Message-----
>> From: Doerr, Martin
>> Sent: Donnerstag, 28. Dezember 2017 18:47
>> To: [hidden email]; Robbin Ehn
>> <[hidden email]>; Lindenmaier, Goetz <[hidden email]>
>> Subject: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX
>> and support SIGTRAP
>>
>> Hi,
>>
>>
>>
>> unfortunately, the safepoint mechanism initialization on AIX is not completely
>> correct, yet. The VM crashes when using -XX:-OptimizePollingPageLocation or
>> when allocation at desired addresses failed.
>>
>> Only pages allocated by mmap can be read protected.
>>
>>
>>
>> In addition, SIGTRAP-based polling performs slightly better on PPC64 and avoids
>> the need for allocating a protected page.
>>
>>
>>
>> I have uploaded a webrev:
>>
>> http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.00/
>>
>>
>>
>> We use trap instructions if UseSIGTRAP is enabled (PPC64 specific -XX flag) and
>> fall back to loads from the polling pages otherwise.
>>
>>
>>
>> Please review.
>>
>>
>>
>> I will also need a sponsor because I'm changing the shared file
>> safepointMechanism.cpp. It's not a functional change for other platforms.
>>
>>
>>
>> Best regards,
>>
>> Martin
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Doerr, Martin
Hi Robbin,

awesome. Thank you very much.

Best regards,
Martin


-----Original Message-----
From: Robbin Ehn [mailto:[hidden email]]
Sent: Mittwoch, 10. Januar 2018 11:08
To: Doerr, Martin <[hidden email]>; Lindenmaier, Goetz <[hidden email]>; [hidden email]
Subject: Re: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Hi Martin,

I tested it with no problem so I'll push it now.

/Robbin

On 01/02/2018 05:35 PM, Doerr, Martin wrote:

> Hi Robbin and Götz,
>
> thanks for reviewing.
>
> I have added a comment, improved safepointMechanism_aix.cpp, adapted the test OsCpuLoggingTest and added reviewer information.
>
> New webrev is here:
> http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.01/
>
> Please take a look.
>
> The change applies to jdk10 (as well as to jdk/hs, but it's targeted to 10). Can somebody sponsor, please?
>
> Thanks and best regards,
> Martin
>
>
> -----Original Message-----
> From: Lindenmaier, Goetz
> Sent: Samstag, 30. Dezember 2017 14:01
> To: Doerr, Martin <[hidden email]>; [hidden email]; Robbin Ehn <[hidden email]>
> Subject: RE: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP
>
> Hi Martin,
>
> thanks for fixing this issue. The change itself looks good.
>
> Nevertheless some points:
> I would like a comment about the sigtrap mechanism used on
> ppc, maybe where the macro for UseSIGTRAP is set.
>
> I think you need to adapt runtime/logging/OsCpuLoggingTest.java.
> The tracing is missing on linuxppc, too, if UseSIGTRAP is set.
> Maybe the test should call the VM with -XX:-UseSIGTRAP on ppc?
> And then it should work on aix, too?
>
> Best regards,
>    Goetz.
>
>> -----Original Message-----
>> From: Doerr, Martin
>> Sent: Donnerstag, 28. Dezember 2017 18:47
>> To: [hidden email]; Robbin Ehn
>> <[hidden email]>; Lindenmaier, Goetz <[hidden email]>
>> Subject: RFR(M): 8194258: PPC64 safepoint mechanism: Fix initialization on AIX
>> and support SIGTRAP
>>
>> Hi,
>>
>>
>>
>> unfortunately, the safepoint mechanism initialization on AIX is not completely
>> correct, yet. The VM crashes when using -XX:-OptimizePollingPageLocation or
>> when allocation at desired addresses failed.
>>
>> Only pages allocated by mmap can be read protected.
>>
>>
>>
>> In addition, SIGTRAP-based polling performs slightly better on PPC64 and avoids
>> the need for allocating a protected page.
>>
>>
>>
>> I have uploaded a webrev:
>>
>> http://cr.openjdk.java.net/~mdoerr/8194258_PPC64_poll/webrev.00/
>>
>>
>>
>> We use trap instructions if UseSIGTRAP is enabled (PPC64 specific -XX flag) and
>> fall back to loads from the polling pages otherwise.
>>
>>
>>
>> Please review.
>>
>>
>>
>> I will also need a sponsor because I'm changing the shared file
>> safepointMechanism.cpp. It's not a functional change for other platforms.
>>
>>
>>
>> Best regards,
>>
>> Martin
>>
>>
>