8378177: AllowExtshm flag cleanup on AIX

Reviewed-by: mdoerr, stuefe
This commit is contained in:
April 2026-03-09 11:52:42 +00:00 committed by Thomas Stuefe
parent 2fc7bdcbd4
commit e69fb7765a
3 changed files with 3 additions and 52 deletions

View File

@ -37,16 +37,6 @@
range, \
constraint) \
\
/* Whether to allow the VM to run if EXTSHM=ON. EXTSHM is an environment */ \
/* variable used on AIX to activate certain hacks which allow more shm segments */\
/* for 32bit processes. For 64bit processes, it is pointless and may have */ \
/* harmful side effects (e.g. for some reasonn prevents allocation of 64k pages */\
/* via shmctl). */ \
/* Per default we quit with an error if that variable is found; for certain */ \
/* customer scenarios, we may want to be able to run despite that variable. */ \
product(bool, AllowExtshm, false, DIAGNOSTIC, \
"Allow VM to run with EXTSHM=ON.") \
\
/* Maximum expected size of the data segment. That correlates with the */ \
/* maximum C Heap consumption we expect. */ \
/* We need to leave "breathing space" for the data segment when */ \

View File

@ -126,7 +126,6 @@ int mread_real_time(timebasestruct_t *t, size_t size_of_timebasestruct_t);
// for multipage initialization error analysis (in 'g_multipage_error')
#define ERROR_MP_OS_TOO_OLD 100
#define ERROR_MP_EXTSHM_ACTIVE 101
#define ERROR_MP_VMGETINFO_FAILED 102
#define ERROR_MP_VMGETINFO_CLAIMS_NO_SUPPORT_FOR_64K 103
@ -178,9 +177,6 @@ uint32_t os::Aix::_os_version = 0;
// -1 = uninitialized, 0 - no, 1 - yes
int os::Aix::_xpg_sus_mode = -1;
// -1 = uninitialized, 0 - no, 1 - yes
int os::Aix::_extshm = -1;
////////////////////////////////////////////////////////////////////////////////
// local variables
@ -1195,13 +1191,6 @@ void os::print_memory_info(outputStream* st) {
const char* const ldr_cntrl = ::getenv("LDR_CNTRL");
st->print_cr(" LDR_CNTRL=%s.", ldr_cntrl ? ldr_cntrl : "<unset>");
// Print out EXTSHM because it is an unsupported setting.
const char* const extshm = ::getenv("EXTSHM");
st->print_cr(" EXTSHM=%s.", extshm ? extshm : "<unset>");
if ( (strcmp(extshm, "on") == 0) || (strcmp(extshm, "ON") == 0) ) {
st->print_cr(" *** Unsupported! Please remove EXTSHM from your environment! ***");
}
// Print out AIXTHREAD_GUARDPAGES because it affects the size of pthread stacks.
const char* const aixthread_guardpages = ::getenv("AIXTHREAD_GUARDPAGES");
st->print_cr(" AIXTHREAD_GUARDPAGES=%s.",
@ -2133,8 +2122,6 @@ void os::init(void) {
// datapsize = 64k. Data segment, thread stacks are 64k paged.
// This normally means that we can allocate 64k pages dynamically.
// (There is one special case where this may be false: EXTSHM=on.
// but we decided to not support that mode).
assert0(g_multipage_support.can_use_64K_pages || g_multipage_support.can_use_64K_mmap_pages);
set_page_size(64*K);
@ -2543,28 +2530,13 @@ void os::Aix::initialize_os_info() {
void os::Aix::scan_environment() {
char* p;
int rc;
// Warn explicitly if EXTSHM=ON is used. That switch changes how
// System V shared memory behaves. One effect is that page size of
// shared memory cannot be change dynamically, effectivly preventing
// large pages from working.
// This switch was needed on AIX 32bit, but on AIX 64bit the general
// recommendation is (in OSS notes) to switch it off.
// Reject EXTSHM=ON. That switch changes how System V shared memory behaves
// and prevents allocation of 64k pages for the heap.
p = ::getenv("EXTSHM");
trcVerbose("EXTSHM=%s.", p ? p : "<unset>");
if (p && strcasecmp(p, "ON") == 0) {
_extshm = 1;
log_warning(os)("*** Unsupported mode! Please remove EXTSHM from your environment! ***");
if (!AllowExtshm) {
// We allow under certain conditions the user to continue. However, we want this
// to be a fatal error by default. On certain AIX systems, leaving EXTSHM=ON means
// that the VM is not able to allocate 64k pages for the heap.
// We do not want to run with reduced performance.
vm_exit_during_initialization("EXTSHM is ON. Please remove EXTSHM from your environment.");
}
} else {
_extshm = 0;
vm_exit_during_initialization("EXTSHM is ON. Please remove EXTSHM from your environment.");
}
// SPEC1170 behaviour: will change the behaviour of a number of POSIX APIs.

View File

@ -49,11 +49,6 @@ class os::Aix {
// 1 - SPEC1170 requested (XPG_SUS_ENV is ON)
static int _xpg_sus_mode;
// -1 = uninitialized,
// 0 - EXTSHM=OFF or not set
// 1 - EXTSHM=ON
static int _extshm;
static bool available_memory(physical_memory_size_type& value);
static bool free_memory(physical_memory_size_type& value);
static physical_memory_size_type physical_memory() { return _physical_memory; }
@ -111,12 +106,6 @@ class os::Aix {
return _xpg_sus_mode;
}
// Returns true if EXTSHM=ON.
static bool extshm() {
assert(_extshm != -1, "not initialized");
return _extshm;
}
// result struct for get_meminfo()
struct meminfo_t {