Skip to content

Commit

Permalink
Merge pull request eclipse-openj9#17073 from hangshao0/FixSCC
Browse files Browse the repository at this point in the history
Add support for persistent SCC on z/OS
  • Loading branch information
keithc-ca authored May 29, 2023
2 parents f988e15 + 40075eb commit 3b029b0
Show file tree
Hide file tree
Showing 27 changed files with 222 additions and 130 deletions.
7 changes: 7 additions & 0 deletions buildspecs/j9.flags
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,13 @@ Only available on zOS</description>
<require flag="interp_jniSupport"/>
</requires>
</flag>
<flag id="opt_shrMsyncSupport">
<description>Support for synchronizing memory with physical storage in shared classes cache</description>
<ifRemoved>No support for synchronizing memory with physical storage in shared classes cache</ifRemoved>
<requires>
<require flag="opt_sharedClasses"/>
</requires>
</flag>
<flag id="opt_sidecar">
<description>Determines if sidecar files are built.</description>
<ifRemoved>Standard J9 VM only - no sidecar support</ifRemoved>
Expand Down
1 change: 1 addition & 0 deletions buildspecs/zos_390-64.spec
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="opt_panama" value="false"/>
<flag id="opt_reflect" value="true"/>
<flag id="opt_sharedClasses" value="true"/>
<flag id="opt_shrMsyncSupport" value="true"/>
<flag id="opt_sidecar" value="true"/>
<flag id="opt_srpAvlTreeSupport" value="true"/>
<flag id="opt_stringCompression" value="true"/>
Expand Down
1 change: 1 addition & 0 deletions buildspecs/zos_390-64_cmprssptrs.spec
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="opt_panama" value="false"/>
<flag id="opt_reflect" value="true"/>
<flag id="opt_sharedClasses" value="true"/>
<flag id="opt_shrMsyncSupport" value="true"/>
<flag id="opt_sidecar" value="true"/>
<flag id="opt_srpAvlTreeSupport" value="true"/>
<flag id="opt_stringCompression" value="true"/>
Expand Down
1 change: 1 addition & 0 deletions buildspecs/zos_390.spec
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="opt_valhallaFlattenableValueTypes" value="false"/>
<flag id="opt_reflect" value="true"/>
<flag id="opt_sharedClasses" value="true"/>
<flag id="opt_shrMsyncSupport" value="true"/>
<flag id="opt_sidecar" value="true"/>
<flag id="opt_srpAvlTreeSupport" value="true"/>
<flag id="opt_stringCompression" value="true"/>
Expand Down
7 changes: 1 addition & 6 deletions runtime/bcutil/jimagereader.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
#include "ut_j9bcu.h"
#include "util_api.h"


#if !defined(OMRPORT_MMAP_FLAG_ZOS_READ_MAPFILE)
#define OMRPORT_MMAP_FLAG_ZOS_READ_MAPFILE 0
#endif /* !defined(OMRPORT_MMAP_FLAG_ZOS_READ_MAPFILE) */

VMINLINE static U_32 hashFn(const char *name, I_32 baseValue);
VMINLINE static I_32 getRedirectTableValue(const char *name, I_32 *redirectTable, U_32 redirectTableSize);
static I_32 verifyJImageHeader(const char *fileName, JImageHeader *header);
Expand Down Expand Up @@ -189,7 +184,7 @@ j9bcutil_loadJImage(J9PortLibrary *portlib, const char *fileName, J9JImage **pji
/*
* With OMRPORT_MMAP_FLAG_ZOS_READ_MAPFILE, j9mmap_map_file() has the old bahaviour that reads the file content into allocated private memory.
*/
mmapflag |= OMRPORT_MMAP_FLAG_ZOS_READ_MAPFILE;
mmapflag = OMRPORT_MMAP_FLAG_ZOS_READ_MAPFILE;
#endif /* defined(J9ZOS390) */
jimage->jimageMmap = j9mmap_map_file(jimagefd, 0, mapSize, fileName, mmapflag, J9MEM_CATEGORY_CLASSES);
if (NULL == jimage->jimageMmap) {
Expand Down
1 change: 1 addition & 0 deletions runtime/cmake/caches/zos_390-64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ set(J9VM_PORT_RUNTIME_INSTRUMENTATION ON CACHE BOOL "")
set(J9VM_THR_ASYNC_NAME_UPDATE OFF CACHE BOOL "")

set(J9VM_ZOS_3164_INTEROPERABILITY ON CACHE BOOL "")
set(J9VM_OPT_SHR_MSYNC_SUPPORT ON CACHE BOOL "")

include("${CMAKE_CURRENT_LIST_DIR}/common.cmake")
1 change: 1 addition & 0 deletions runtime/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,4 @@ option(J9VM_PORT_RUNTIME_INSTRUMENTATION "Controls whether runtime instrumentati
option(J9VM_USE_RDYNAMIC "Link using the -rdynamic option (Linux only)" OFF)

option(J9VM_ZOS_3164_INTEROPERABILITY "Enables support for 64-bit zOS to interoperate with 31-bit JNI native targets.")
option(J9VM_OPT_SHR_MSYNC_SUPPORT "Enables support for synchronizing memory with physical storage in shared classes cache.")
1 change: 1 addition & 0 deletions runtime/include/j9cfg.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ extern "C" {
#cmakedefine J9VM_OPT_RESOURCE_MANAGED
#cmakedefine J9VM_OPT_ROM_IMAGE_SUPPORT
#cmakedefine J9VM_OPT_SHARED_CLASSES
#cmakedefine J9VM_OPT_SHR_MSYNC_SUPPORT
#cmakedefine J9VM_OPT_SIDECAR
#cmakedefine J9VM_OPT_SRP_AVL_TREE_SUPPORT
#cmakedefine J9VM_OPT_STRING_COMPRESSION
Expand Down
21 changes: 21 additions & 0 deletions runtime/nls/shrc/j9shr.nls
Original file line number Diff line number Diff line change
Expand Up @@ -6896,3 +6896,24 @@ J9NLS_SHRC_CM_PRINTSTATS_PROCESSOR_FEATURES.explanation=NOTAG
J9NLS_SHRC_CM_PRINTSTATS_PROCESSOR_FEATURES.system_action=
J9NLS_SHRC_CM_PRINTSTATS_PROCESSOR_FEATURES.user_response=
# END NON-TRANSLATABLE

J9NLS_CC_MSYNC_UNSUPPORTED=The system does not support synchronizing memory with physical storage.
# START NON-TRANSLATABLE
J9NLS_CC_MSYNC_UNSUPPORTED.explanation=Synchronization between memory and physical storage is not supported on the runtime platform, so the feature is disabled.
J9NLS_CC_MSYNC_UNSUPPORTED.system_action=The JVM won't force the operating system to flush changes in memory to the physical storage.
J9NLS_CC_MSYNC_UNSUPPORTED.user_response=No action required.
# END NON-TRANSLATABLE

J9NLS_SHRC_SHRINIT_HELPTEXT_MAP31=Map the shared class cache below the 2G addressing range.
# START NON-TRANSLATABLE
J9NLS_SHRC_SHRINIT_HELPTEXT_MAP31.explanation=NOTAG
J9NLS_SHRC_SHRINIT_HELPTEXT_MAP31.system_action=
J9NLS_SHRC_SHRINIT_HELPTEXT_MAP31.user_response=
# END NON-TRANSLATABLE

J9NLS_SHRC_OSCACHE_MMAP_MSYNC_ERROR=Error Synchronizing memory.
# START NON-TRANSLATABLE
J9NLS_SHRC_OSCACHE_MMAP_MSYNC_ERROR.explanation=An error has occurred in shared class processing.
J9NLS_SHRC_OSCACHE_MMAP_MSYNC_ERROR.system_action=The JVM terminates, unless you have specified the non-fatal option with "-Xshareclasses:nonfatal", in which case the JVM continues without using shared classes.
J9NLS_SHRC_OSCACHE_MMAP_MSYNC_ERROR.user_response=Contact your service representative.
# END NON-TRANSLATABLE
3 changes: 3 additions & 0 deletions runtime/oti/j9port.h
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,9 @@ typedef struct J9CacheInfoQuery {
#define J9PORT_MMAP_FLAG_SHARED OMRPORT_MMAP_FLAG_SHARED
#define J9PORT_MMAP_FLAG_COPYONWRITE OMRPORT_MMAP_FLAG_COPYONWRITE
#define J9PORT_MMAP_SYNC_WAIT OMRPORT_MMAP_SYNC_WAIT
#if defined(J9ZOS39064)
#define J9PORT_MMAP_FLAG_ZOS_64BIT OMRPORT_MMAP_FLAG_ZOS_64BIT
#endif /* defined(J9ZOS39064) */

#define J9PORT_RESOURCE_SHARED_MEMORY OMRPORT_RESOURCE_SHARED_MEMORY
#define J9PORT_RESOURCE_ADDRESS_SPACE OMRPORT_RESOURCE_ADDRESS_SPACE
Expand Down
2 changes: 1 addition & 1 deletion runtime/oti/shcflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#define J9SHR_RUNTIMEFLAG_ENABLE_NONFATAL 0x2000
#define J9SHR_RUNTIMEFLAG_DO_DESTROY_CONFIG 0x4000
#define J9SHR_RUNTIMEFLAG_BLOCK_SPACE_FULL 0x8000
// Available 0x10000
#define J9SHR_RUNTIMEFLAG_MAP31 0x10000
#define J9SHR_RUNTIMEFLAG_ENABLE_AOT 0x20000
#define J9SHR_RUNTIMEFLAG_ENABLE_PERSISTENT_CACHE 0x40000
#define J9SHR_RUNTIMEFLAG_ENABLE_GROUP_ACCESS 0x80000
Expand Down
25 changes: 0 additions & 25 deletions runtime/oti/util_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2490,31 +2490,6 @@ const char* props_file_get(j9props_file_t file, const char* key);
*/
void props_file_do(j9props_file_t file, j9props_file_iterator iterator, void* userData);



/* ----------------- zosversion.c ---------------- */

/**
* Function to determine if the zos version is at least a given
* release and version. The implementation is based on uname(),
* NOT on __osname() as the __osname() release numbers are not
* guaranteed to increase.
*
* For release and version numbers, see
* http://publib.boulder.ibm.com/infocenter/zos/v1r10/index.jsp?topic=/com.ibm.zos.r10.bpxbd00/osnm.htm
*
* Operating System Sysname Release Version
* z/OS V1.10 OS/390 20.00 03
* z/OS 1.9 OS/390 19.00 03
* z/OS 1.8 or z/OS.e 1.8 OS/390 18.00 03
* z/OS 1.7 or z/OS.e 1.7 OS/390 17.00 03
* z/OS 1.6 or z/OS.e 1.6 OS/390 16.00 03
*/
BOOLEAN
zos_version_at_least(double min_release, double min_version);



/* ----------------- ObjectHash.cpp ---------------- */
/**
* Hash an UDATA via murmur3 algorithm
Expand Down
Loading

0 comments on commit 3b029b0

Please sign in to comment.