Skip to content

Commit

Permalink
8328604: remove on_aix() function
Browse files Browse the repository at this point in the history
Reviewed-by: clanger, stuefe
  • Loading branch information
MBaesken committed Mar 22, 2024
1 parent d44aaa3 commit 940d196
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 39 deletions.
32 changes: 7 additions & 25 deletions src/hotspot/os/aix/os_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,8 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
guarantee(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) == 0, "???");

// Make sure we run in 1:1 kernel-user-thread mode.
if (os::Aix::on_aix()) {
guarantee(pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0, "???");
guarantee(pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) == 0, "???");
}
guarantee(pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0, "???");
guarantee(pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) == 0, "???");

// Start in suspended state, and in os::thread_start, wake the thread up.
guarantee(pthread_attr_setsuspendstate_np(&attr, PTHREAD_CREATE_SUSPENDED_NP) == 0, "???");
Expand Down Expand Up @@ -1295,22 +1293,10 @@ void os::print_memory_info(outputStream* st) {

os::Aix::meminfo_t mi;
if (os::Aix::get_meminfo(&mi)) {
if (os::Aix::on_aix()) {
st->print_cr("physical total : " SIZE_FORMAT, mi.real_total);
st->print_cr("physical free : " SIZE_FORMAT, mi.real_free);
st->print_cr("swap total : " SIZE_FORMAT, mi.pgsp_total);
st->print_cr("swap free : " SIZE_FORMAT, mi.pgsp_free);
} else {
// PASE - Numbers are result of QWCRSSTS; they mean:
// real_total: Sum of all system pools
// real_free: always 0
// pgsp_total: we take the size of the system ASP
// pgsp_free: size of system ASP times percentage of system ASP unused
st->print_cr("physical total : " SIZE_FORMAT, mi.real_total);
st->print_cr("system asp total : " SIZE_FORMAT, mi.pgsp_total);
st->print_cr("%% system asp used : %.2f",
mi.pgsp_total ? (100.0f * (mi.pgsp_total - mi.pgsp_free) / mi.pgsp_total) : -1.0f);
}
st->print_cr("physical total : " SIZE_FORMAT, mi.real_total);
st->print_cr("physical free : " SIZE_FORMAT, mi.real_free);
st->print_cr("swap total : " SIZE_FORMAT, mi.pgsp_total);
st->print_cr("swap free : " SIZE_FORMAT, mi.pgsp_free);
}
st->cr();

Expand Down Expand Up @@ -2420,9 +2406,7 @@ void os::init(void) {
}

// Reset the perfstat information provided by ODM.
if (os::Aix::on_aix()) {
libperfstat::perfstat_reset();
}
libperfstat::perfstat_reset();

// Now initialize basic system properties. Note that for some of the values we
// need libperfstat etc.
Expand Down Expand Up @@ -2943,9 +2927,7 @@ void os::Aix::initialize_libo4() {
}
}

// AIX: initialize the libperfstat library.
void os::Aix::initialize_libperfstat() {
assert(os::Aix::on_aix(), "AIX only");
if (!libperfstat::init()) {
trcVerbose("libperfstat initialization failed.");
assert(false, "libperfstat initialization failed");
Expand Down
16 changes: 2 additions & 14 deletions src/hotspot/os/aix/os_aix.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023 SAP SE. All rights reserved.
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -101,13 +101,6 @@ class os::Aix {
return _on_pase ? true : false;
}

// Function returns true if we run on AIX, false if we run on OS/400
// (pase).
static bool on_aix() {
assert(_on_pase != -1, "not initialized");
return _on_pase ? false : true;
}

// Get 4 byte AIX kernel version number:
// highest 2 bytes: Version, Release
// if available: lowest 2 bytes: Tech Level, Service Pack.
Expand All @@ -130,11 +123,6 @@ class os::Aix {
return on_pase() && os_version_short() <= 0x0504;
}

// Convenience method: returns true if running on AIX 5.3 or older.
static bool on_aix_53_or_older() {
return on_aix() && os_version_short() <= 0x0503;
}

// Returns true if we run in SPEC1170 compliant mode (XPG_SUS_ENV=ON).
static bool xpg_sus_mode() {
assert(_xpg_sus_mode != -1, "not initialized");
Expand Down

0 comments on commit 940d196

Please sign in to comment.