8192898: AIX build broken after 8190308

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

8192898: AIX build broken after 8190308

Doerr, Martin
Hi,

I have opened a new bug jdk-8192898.
"MAP_NORESERVE" was introduced in os_posix.cpp. It is not POSIX and it is not defined on AIX. Not sure if any other OS is affected, too.

Should non-POSIX code be in os_posix.cpp?

I can provide a trivial fix for AIX (see below). But maybe somebody has a better idea?

Best regards,
Martin


--- a/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:05:57 2017 +0100
+++ b/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:55:02 2017 +0100
@@ -200,7 +200,7 @@

static char* reserve_mmapped_memory(size_t bytes, char* requested_addr) {
   char * addr;
-  int flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS;
+  int flags = MAP_PRIVATE NOT_AIX( | MAP_NORESERVE ) | MAP_ANONYMOUS;
   if (requested_addr != NULL) {
     assert((uintptr_t)requested_addr % os::vm_page_size() == 0, "Requested address should be aligned to OS page size");
     flags |= MAP_FIXED;
Reply | Threaded
Open this post in threaded view
|

Re: 8192898: AIX build broken after 8190308

coleen.phillimore

Hi Martin,

I will sponsor your trivial fix so that it gets pushed today before the
jdk10 deadline.  The OS's that Oracle supports seem not affected but we
can open a bug if we find other OS's that become broken.

os_posix is tricky for AIX because it seems AIX is posix-like enough to
not want to duplicate the code for AIX.   It seems reasonable to have
this conditional compilation.

Thanks,
Coleen

On 12/1/17 9:03 AM, Doerr, Martin wrote:

> Hi,
>
> I have opened a new bug jdk-8192898.
> "MAP_NORESERVE" was introduced in os_posix.cpp. It is not POSIX and it is not defined on AIX. Not sure if any other OS is affected, too.
>
> Should non-POSIX code be in os_posix.cpp?
>
> I can provide a trivial fix for AIX (see below). But maybe somebody has a better idea?
>
> Best regards,
> Martin
>
>
> --- a/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:05:57 2017 +0100
> +++ b/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:55:02 2017 +0100
> @@ -200,7 +200,7 @@
>
> static char* reserve_mmapped_memory(size_t bytes, char* requested_addr) {
>     char * addr;
> -  int flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS;
> +  int flags = MAP_PRIVATE NOT_AIX( | MAP_NORESERVE ) | MAP_ANONYMOUS;
>     if (requested_addr != NULL) {
>       assert((uintptr_t)requested_addr % os::vm_page_size() == 0, "Requested address should be aligned to OS page size");
>       flags |= MAP_FIXED;

Reply | Threaded
Open this post in threaded view
|

RE: 8192898: AIX build broken after 8190308

Doerr, Martin
Hi Coleen,

thanks a lot for your help. Makes sense.

Best regards,
Martin


-----Original Message-----
From: hotspot-runtime-dev [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Freitag, 1. Dezember 2017 16:57
To: [hidden email]
Subject: Re: 8192898: AIX build broken after 8190308


Hi Martin,

I will sponsor your trivial fix so that it gets pushed today before the
jdk10 deadline.  The OS's that Oracle supports seem not affected but we
can open a bug if we find other OS's that become broken.

os_posix is tricky for AIX because it seems AIX is posix-like enough to
not want to duplicate the code for AIX.   It seems reasonable to have
this conditional compilation.

Thanks,
Coleen

On 12/1/17 9:03 AM, Doerr, Martin wrote:

> Hi,
>
> I have opened a new bug jdk-8192898.
> "MAP_NORESERVE" was introduced in os_posix.cpp. It is not POSIX and it is not defined on AIX. Not sure if any other OS is affected, too.
>
> Should non-POSIX code be in os_posix.cpp?
>
> I can provide a trivial fix for AIX (see below). But maybe somebody has a better idea?
>
> Best regards,
> Martin
>
>
> --- a/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:05:57 2017 +0100
> +++ b/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:55:02 2017 +0100
> @@ -200,7 +200,7 @@
>
> static char* reserve_mmapped_memory(size_t bytes, char* requested_addr) {
>     char * addr;
> -  int flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS;
> +  int flags = MAP_PRIVATE NOT_AIX( | MAP_NORESERVE ) | MAP_ANONYMOUS;
>     if (requested_addr != NULL) {
>       assert((uintptr_t)requested_addr % os::vm_page_size() == 0, "Requested address should be aligned to OS page size");
>       flags |= MAP_FIXED;

Reply | Threaded
Open this post in threaded view
|

Re: 8192898: AIX build broken after 8190308

David Holmes
In reply to this post by Doerr, Martin
Hi Martin,

On 2/12/2017 12:03 AM, Doerr, Martin wrote:
> Hi,
>
> I have opened a new bug jdk-8192898.
> "MAP_NORESERVE" was introduced in os_posix.cpp. It is not POSIX and it is not defined on AIX. Not sure if any other OS is affected, too.
>
> Should non-POSIX code be in os_posix.cpp?

In principle not. That file is starting to become a common place to
mostly-share code that is mostly-common across non-Windows platforms. I
would prefer to see this file contain predominantly POSIX code with
necessary tweaks on a platform basis. Otherwise it may be better to
rename the file to avoid confusion.

> I can provide a trivial fix for AIX (see below). But maybe somebody has a better idea?

I would prefer to see the use of non-POSIX conforming code be
conditionalized on the platforms that are known to support it - ie
platforms have to specifically opt-in to using it because someone has
determined that it does in fact work, and is needed, for that platform.
That should have been done by the people who worked on 8190308. I can't
expect you to do that for the other platforms, so fixing AIX the way you
suggest is the most pragmatic thing to do right now.

Thanks,
David

> Best regards,
> Martin
>
>
> --- a/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:05:57 2017 +0100
> +++ b/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:55:02 2017 +0100
> @@ -200,7 +200,7 @@
>
> static char* reserve_mmapped_memory(size_t bytes, char* requested_addr) {
>     char * addr;
> -  int flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS;
> +  int flags = MAP_PRIVATE NOT_AIX( | MAP_NORESERVE ) | MAP_ANONYMOUS;
>     if (requested_addr != NULL) {
>       assert((uintptr_t)requested_addr % os::vm_page_size() == 0, "Requested address should be aligned to OS page size");
>       flags |= MAP_FIXED;
>