Skip to content

Commit

Permalink
Issue eclipse-omr#142 use the correct z/OS control block field to cal…
Browse files Browse the repository at this point in the history
…culate physical memory

On z/OS, omrsysinfo_get_physical_memory() uses the CVTRLSTG field which returns the
amount of physical memory at IPL.
This value may not be correct at the time due to reconfigurable memory.
The correct field is RCEPOOL.

Signed-off-by: Peter Bain <[email protected]>
  • Loading branch information
pdbain-ibm committed Jun 16, 2016
1 parent aba25db commit 3925eb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 77 deletions.
1 change: 0 additions & 1 deletion port/port_objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ ifeq (zos,$(OMR_HOST_OS))
OBJECTS += j9sysinfo_get_number_CPUs
OBJECTS += j9jobname
OBJECTS += j9userid
OBJECTS += j9sysinfo_get_physical_memory
OBJECTS += j9csrsi
OBJECTS += j9csrsi_wrp
OBJECTS += j9zfs
Expand Down
12 changes: 6 additions & 6 deletions port/unix/omrsysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#endif

#if defined(J9ZOS390)
#include "omrsimap.h"
#include "omrsysinfo_helpers.h"
#include "omrcsrsi.h"
#endif /* defined(J9ZOS390) */
Expand Down Expand Up @@ -151,10 +152,6 @@
#pragma map (Get_Number_Of_CPUs,"GETNCPUS")
uintptr_t Get_Number_Of_CPUs();

#pragma linkage (GETPHYM,OS)
#pragma map (Get_Physical_Memory,"GETPHYM")
uintptr_t Get_Physical_Memory();

#endif

#define JIFFIES 100
Expand Down Expand Up @@ -1441,8 +1438,11 @@ omrsysinfo_get_physical_memory(struct OMRPortLibrary *portLibrary)
/* on systems with 43K headers. However, this is not an issue as we only support AIX 5.2 and above only */
return (uint64_t) _system_configuration.physmem;
#elif defined(J9ZOS390)
/* Get_Physical_Memory returns "SIZE OF ACTUAL REAL STORAGE ONLINE IN 'K'" */
return (uint64_t)Get_Physical_Memory() * 1024;
U_64 result = 0;
J9CVT * __ptr32 cvtp = ((J9PSA * __ptr32)0)->flccvt;
J9RCE * __ptr32 rcep = cvtp->cvtrcep;
result = ((U_64)rcep->rcepool * J9BYTES_PER_PAGE);
return result;
#elif defined(OSX)
int name[2] = {CTL_HW, HW_MEMSIZE};
uint64_t size = 0;
Expand Down
70 changes: 0 additions & 70 deletions port/zos390/j9sysinfo_get_physical_memory.s

This file was deleted.

0 comments on commit 3925eb5

Please sign in to comment.