Merge
This commit is contained in:
commit
d9ae342dff
@ -30,15 +30,6 @@
|
||||
//
|
||||
#define RUNTIME_OS_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \
|
||||
\
|
||||
product(bool, UseISM, false, \
|
||||
"Use Intimate Shared Memory (Solaris Only)") \
|
||||
\
|
||||
product(bool, UsePermISM, false, \
|
||||
"Obsolete flag for compatibility (same as UseISM)") \
|
||||
\
|
||||
product(bool, UseMPSS, true, \
|
||||
"Use Multiple Page Size Support (Solaris 9 Only)") \
|
||||
\
|
||||
product(bool, UseExtendedFileIO, true, \
|
||||
"Enable workaround for limitations of stdio FILE structure")
|
||||
|
||||
|
@ -115,45 +115,6 @@
|
||||
// for timer info max values which include all bits
|
||||
#define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
// See bug #6514594
|
||||
extern "C" int madvise(caddr_t, size_t, int);
|
||||
extern "C" int memcntl(caddr_t addr, size_t len, int cmd, caddr_t arg,
|
||||
int attr, int mask);
|
||||
#endif //_GNU_SOURCE
|
||||
|
||||
/*
|
||||
MPSS Changes Start.
|
||||
The JVM binary needs to be built and run on pre-Solaris 9
|
||||
systems, but the constants needed by MPSS are only in Solaris 9
|
||||
header files. They are textually replicated here to allow
|
||||
building on earlier systems. Once building on Solaris 8 is
|
||||
no longer a requirement, these #defines can be replaced by ordinary
|
||||
system .h inclusion.
|
||||
|
||||
In earlier versions of the JDK and Solaris, we used ISM for large pages.
|
||||
But ISM requires shared memory to achieve this and thus has many caveats.
|
||||
MPSS is a fully transparent and is a cleaner way to get large pages.
|
||||
Although we still require keeping ISM for backward compatiblitiy as well as
|
||||
giving the opportunity to use large pages on older systems it is
|
||||
recommended that MPSS be used for Solaris 9 and above.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef MC_HAT_ADVISE
|
||||
|
||||
struct memcntl_mha {
|
||||
uint_t mha_cmd; /* command(s) */
|
||||
uint_t mha_flags;
|
||||
size_t mha_pagesize;
|
||||
};
|
||||
#define MC_HAT_ADVISE 7 /* advise hat map size */
|
||||
#define MHA_MAPSIZE_VA 0x1 /* set preferred page size */
|
||||
#define MAP_ALIGN 0x200 /* addr specifies alignment */
|
||||
|
||||
#endif
|
||||
// MPSS Changes End.
|
||||
|
||||
|
||||
// Here are some liblgrp types from sys/lgrp_user.h to be able to
|
||||
// compile on older systems without this header file.
|
||||
@ -172,32 +133,6 @@ struct memcntl_mha {
|
||||
# define LGRP_RSRC_MEM 1 /* memory resources */
|
||||
#endif
|
||||
|
||||
// Some more macros from sys/mman.h that are not present in Solaris 8.
|
||||
|
||||
#ifndef MAX_MEMINFO_CNT
|
||||
/*
|
||||
* info_req request type definitions for meminfo
|
||||
* request types starting with MEMINFO_V are used for Virtual addresses
|
||||
* and should not be mixed with MEMINFO_PLGRP which is targeted for Physical
|
||||
* addresses
|
||||
*/
|
||||
# define MEMINFO_SHIFT 16
|
||||
# define MEMINFO_MASK (0xFF << MEMINFO_SHIFT)
|
||||
# define MEMINFO_VPHYSICAL (0x01 << MEMINFO_SHIFT) /* get physical addr */
|
||||
# define MEMINFO_VLGRP (0x02 << MEMINFO_SHIFT) /* get lgroup */
|
||||
# define MEMINFO_VPAGESIZE (0x03 << MEMINFO_SHIFT) /* size of phys page */
|
||||
# define MEMINFO_VREPLCNT (0x04 << MEMINFO_SHIFT) /* no. of replica */
|
||||
# define MEMINFO_VREPL (0x05 << MEMINFO_SHIFT) /* physical replica */
|
||||
# define MEMINFO_VREPL_LGRP (0x06 << MEMINFO_SHIFT) /* lgrp of replica */
|
||||
# define MEMINFO_PLGRP (0x07 << MEMINFO_SHIFT) /* lgroup for paddr */
|
||||
|
||||
/* maximum number of addresses meminfo() can process at a time */
|
||||
# define MAX_MEMINFO_CNT 256
|
||||
|
||||
/* maximum number of request types */
|
||||
# define MAX_MEMINFO_REQ 31
|
||||
#endif
|
||||
|
||||
// see thr_setprio(3T) for the basis of these numbers
|
||||
#define MinimumPriority 0
|
||||
#define NormalPriority 64
|
||||
@ -2884,7 +2819,7 @@ int os::Solaris::commit_memory_impl(char* addr, size_t bytes,
|
||||
size_t alignment_hint, bool exec) {
|
||||
int err = Solaris::commit_memory_impl(addr, bytes, exec);
|
||||
if (err == 0) {
|
||||
if (UseMPSS && alignment_hint > (size_t)vm_page_size()) {
|
||||
if (UseLargePages && (alignment_hint > (size_t)vm_page_size())) {
|
||||
// If the large page size has been set and the VM
|
||||
// is using large pages, use the large page size
|
||||
// if it is smaller than the alignment hint. This is
|
||||
@ -2903,7 +2838,7 @@ int os::Solaris::commit_memory_impl(char* addr, size_t bytes,
|
||||
page_size = alignment_hint;
|
||||
}
|
||||
// Since this is a hint, ignore any failures.
|
||||
(void)Solaris::set_mpss_range(addr, bytes, page_size);
|
||||
(void)Solaris::setup_large_pages(addr, bytes, page_size);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
@ -2946,8 +2881,8 @@ bool os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||
assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
|
||||
assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
|
||||
if (UseLargePages && UseMPSS) {
|
||||
Solaris::set_mpss_range(addr, bytes, alignment_hint);
|
||||
if (UseLargePages) {
|
||||
Solaris::setup_large_pages(addr, bytes, alignment_hint);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3346,47 +3281,8 @@ bool os::unguard_memory(char* addr, size_t bytes) {
|
||||
}
|
||||
|
||||
// Large page support
|
||||
|
||||
// UseLargePages is the master flag to enable/disable large page memory.
|
||||
// UseMPSS and UseISM are supported for compatibility reasons. Their combined
|
||||
// effects can be described in the following table:
|
||||
//
|
||||
// UseLargePages UseMPSS UseISM
|
||||
// false * * => UseLargePages is the master switch, turning
|
||||
// it off will turn off both UseMPSS and
|
||||
// UseISM. VM will not use large page memory
|
||||
// regardless the settings of UseMPSS/UseISM.
|
||||
// true false false => Unless future Solaris provides other
|
||||
// mechanism to use large page memory, this
|
||||
// combination is equivalent to -UseLargePages,
|
||||
// VM will not use large page memory
|
||||
// true true false => JVM will use MPSS for large page memory.
|
||||
// This is the default behavior.
|
||||
// true false true => JVM will use ISM for large page memory.
|
||||
// true true true => JVM will use ISM if it is available.
|
||||
// Otherwise, JVM will fall back to MPSS.
|
||||
// Becaues ISM is now available on all
|
||||
// supported Solaris versions, this combination
|
||||
// is equivalent to +UseISM -UseMPSS.
|
||||
|
||||
static size_t _large_page_size = 0;
|
||||
|
||||
bool os::Solaris::ism_sanity_check(bool warn, size_t * page_size) {
|
||||
// x86 uses either 2M or 4M page, depending on whether PAE (Physical Address
|
||||
// Extensions) mode is enabled. AMD64/EM64T uses 2M page in 64bit mode. Sparc
|
||||
// can support multiple page sizes.
|
||||
|
||||
// Don't bother to probe page size because getpagesizes() comes with MPSS.
|
||||
// ISM is only recommended on old Solaris where there is no MPSS support.
|
||||
// Simply choose a conservative value as default.
|
||||
*page_size = LargePageSizeInBytes ? LargePageSizeInBytes :
|
||||
SPARC_ONLY(4 * M) IA32_ONLY(4 * M) AMD64_ONLY(2 * M)
|
||||
ARM_ONLY(2 * M);
|
||||
|
||||
// ISM is available on all supported Solaris versions
|
||||
return true;
|
||||
}
|
||||
|
||||
// Insertion sort for small arrays (descending order).
|
||||
static void insertion_sort_descending(size_t* array, int len) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
@ -3399,7 +3295,7 @@ static void insertion_sort_descending(size_t* array, int len) {
|
||||
}
|
||||
}
|
||||
|
||||
bool os::Solaris::mpss_sanity_check(bool warn, size_t * page_size) {
|
||||
bool os::Solaris::mpss_sanity_check(bool warn, size_t* page_size) {
|
||||
const unsigned int usable_count = VM_Version::page_size_count();
|
||||
if (usable_count == 1) {
|
||||
return false;
|
||||
@ -3465,41 +3361,24 @@ bool os::Solaris::mpss_sanity_check(bool warn, size_t * page_size) {
|
||||
}
|
||||
|
||||
void os::large_page_init() {
|
||||
if (!UseLargePages) {
|
||||
UseISM = false;
|
||||
UseMPSS = false;
|
||||
return;
|
||||
if (UseLargePages) {
|
||||
// print a warning if any large page related flag is specified on command line
|
||||
bool warn_on_failure = !FLAG_IS_DEFAULT(UseLargePages) ||
|
||||
!FLAG_IS_DEFAULT(LargePageSizeInBytes);
|
||||
|
||||
UseLargePages = Solaris::mpss_sanity_check(warn_on_failure, &_large_page_size);
|
||||
}
|
||||
|
||||
// print a warning if any large page related flag is specified on command line
|
||||
bool warn_on_failure = !FLAG_IS_DEFAULT(UseLargePages) ||
|
||||
!FLAG_IS_DEFAULT(UseISM) ||
|
||||
!FLAG_IS_DEFAULT(UseMPSS) ||
|
||||
!FLAG_IS_DEFAULT(LargePageSizeInBytes);
|
||||
UseISM = UseISM &&
|
||||
Solaris::ism_sanity_check(warn_on_failure, &_large_page_size);
|
||||
if (UseISM) {
|
||||
// ISM disables MPSS to be compatible with old JDK behavior
|
||||
UseMPSS = false;
|
||||
_page_sizes[0] = _large_page_size;
|
||||
_page_sizes[1] = vm_page_size();
|
||||
}
|
||||
|
||||
UseMPSS = UseMPSS &&
|
||||
Solaris::mpss_sanity_check(warn_on_failure, &_large_page_size);
|
||||
|
||||
UseLargePages = UseISM || UseMPSS;
|
||||
}
|
||||
|
||||
bool os::Solaris::set_mpss_range(caddr_t start, size_t bytes, size_t align) {
|
||||
bool os::Solaris::setup_large_pages(caddr_t start, size_t bytes, size_t align) {
|
||||
// Signal to OS that we want large pages for addresses
|
||||
// from addr, addr + bytes
|
||||
struct memcntl_mha mpss_struct;
|
||||
mpss_struct.mha_cmd = MHA_MAPSIZE_VA;
|
||||
mpss_struct.mha_pagesize = align;
|
||||
mpss_struct.mha_flags = 0;
|
||||
if (memcntl(start, bytes, MC_HAT_ADVISE,
|
||||
(caddr_t) &mpss_struct, 0, 0) < 0) {
|
||||
// Upon successful completion, memcntl() returns 0
|
||||
if (memcntl(start, bytes, MC_HAT_ADVISE, (caddr_t) &mpss_struct, 0, 0)) {
|
||||
debug_only(warning("Attempt to use MPSS failed."));
|
||||
return false;
|
||||
}
|
||||
@ -3507,72 +3386,13 @@ bool os::Solaris::set_mpss_range(caddr_t start, size_t bytes, size_t align) {
|
||||
}
|
||||
|
||||
char* os::reserve_memory_special(size_t size, char* addr, bool exec) {
|
||||
// "exec" is passed in but not used. Creating the shared image for
|
||||
// the code cache doesn't have an SHM_X executable permission to check.
|
||||
assert(UseLargePages && UseISM, "only for ISM large pages");
|
||||
|
||||
char* retAddr = NULL;
|
||||
int shmid;
|
||||
key_t ismKey;
|
||||
|
||||
bool warn_on_failure = UseISM &&
|
||||
(!FLAG_IS_DEFAULT(UseLargePages) ||
|
||||
!FLAG_IS_DEFAULT(UseISM) ||
|
||||
!FLAG_IS_DEFAULT(LargePageSizeInBytes)
|
||||
);
|
||||
char msg[128];
|
||||
|
||||
ismKey = IPC_PRIVATE;
|
||||
|
||||
// Create a large shared memory region to attach to based on size.
|
||||
// Currently, size is the total size of the heap
|
||||
shmid = shmget(ismKey, size, SHM_R | SHM_W | IPC_CREAT);
|
||||
if (shmid == -1){
|
||||
if (warn_on_failure) {
|
||||
jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
|
||||
warning(msg);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Attach to the region
|
||||
retAddr = (char *) shmat(shmid, 0, SHM_SHARE_MMU | SHM_R | SHM_W);
|
||||
int err = errno;
|
||||
|
||||
// Remove shmid. If shmat() is successful, the actual shared memory segment
|
||||
// will be deleted when it's detached by shmdt() or when the process
|
||||
// terminates. If shmat() is not successful this will remove the shared
|
||||
// segment immediately.
|
||||
shmctl(shmid, IPC_RMID, NULL);
|
||||
|
||||
if (retAddr == (char *) -1) {
|
||||
if (warn_on_failure) {
|
||||
jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
|
||||
warning(msg);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if ((retAddr != NULL) && UseNUMAInterleaving) {
|
||||
numa_make_global(retAddr, size);
|
||||
}
|
||||
|
||||
// The memory is committed
|
||||
MemTracker::record_virtual_memory_reserve_and_commit((address)retAddr, size, mtNone, CURRENT_PC);
|
||||
|
||||
return retAddr;
|
||||
fatal("os::reserve_memory_special should not be called on Solaris.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool os::release_memory_special(char* base, size_t bytes) {
|
||||
MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker();
|
||||
// detaching the SHM segment will also delete it, see reserve_memory_special()
|
||||
int rslt = shmdt(base);
|
||||
if (rslt == 0) {
|
||||
tkr.record((address)base, bytes);
|
||||
return true;
|
||||
} else {
|
||||
tkr.discard();
|
||||
return false;
|
||||
}
|
||||
fatal("os::release_memory_special should not be called on Solaris.");
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t os::large_page_size() {
|
||||
@ -3582,11 +3402,11 @@ size_t os::large_page_size() {
|
||||
// MPSS allows application to commit large page memory on demand; with ISM
|
||||
// the entire memory region must be allocated as shared memory.
|
||||
bool os::can_commit_large_page_memory() {
|
||||
return UseISM ? false : true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool os::can_execute_large_page_memory() {
|
||||
return UseISM ? false : true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int os_sleep(jlong millis, bool interruptible) {
|
||||
@ -3860,28 +3680,6 @@ static bool priocntl_enable = false;
|
||||
static const int criticalPrio = 60; // FX/60 is critical thread class/priority on T4
|
||||
static int java_MaxPriority_to_os_priority = 0; // Saved mapping
|
||||
|
||||
// Call the version of priocntl suitable for all supported versions
|
||||
// of Solaris. We need to call through this wrapper so that we can
|
||||
// build on Solaris 9 and run on Solaris 8, 9 and 10.
|
||||
//
|
||||
// This code should be removed if we ever stop supporting Solaris 8
|
||||
// and earlier releases.
|
||||
|
||||
static long priocntl_stub(int pcver, idtype_t idtype, id_t id, int cmd, caddr_t arg);
|
||||
typedef long (*priocntl_type)(int pcver, idtype_t idtype, id_t id, int cmd, caddr_t arg);
|
||||
static priocntl_type priocntl_ptr = priocntl_stub;
|
||||
|
||||
// Stub to set the value of the real pointer, and then call the real
|
||||
// function.
|
||||
|
||||
static long priocntl_stub(int pcver, idtype_t idtype, id_t id, int cmd, caddr_t arg) {
|
||||
// Try Solaris 8- name only.
|
||||
priocntl_type tmp = (priocntl_type)dlsym(RTLD_DEFAULT, "__priocntl");
|
||||
guarantee(tmp != NULL, "priocntl function not found.");
|
||||
priocntl_ptr = tmp;
|
||||
return (*priocntl_ptr)(PC_VERSION, idtype, id, cmd, arg);
|
||||
}
|
||||
|
||||
|
||||
// lwp_priocntl_init
|
||||
//
|
||||
@ -3889,9 +3687,7 @@ static long priocntl_stub(int pcver, idtype_t idtype, id_t id, int cmd, caddr_t
|
||||
//
|
||||
// Return errno or 0 if OK.
|
||||
//
|
||||
static
|
||||
int lwp_priocntl_init ()
|
||||
{
|
||||
static int lwp_priocntl_init () {
|
||||
int rslt;
|
||||
pcinfo_t ClassInfo;
|
||||
pcparms_t ParmInfo;
|
||||
@ -3931,7 +3727,7 @@ int lwp_priocntl_init ()
|
||||
|
||||
strcpy(ClassInfo.pc_clname, "TS");
|
||||
ClassInfo.pc_cid = -1;
|
||||
rslt = (*priocntl_ptr)(PC_VERSION, P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
|
||||
rslt = priocntl(P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
|
||||
if (rslt < 0) return errno;
|
||||
assert(ClassInfo.pc_cid != -1, "cid for TS class is -1");
|
||||
tsLimits.schedPolicy = ClassInfo.pc_cid;
|
||||
@ -3940,7 +3736,7 @@ int lwp_priocntl_init ()
|
||||
|
||||
strcpy(ClassInfo.pc_clname, "IA");
|
||||
ClassInfo.pc_cid = -1;
|
||||
rslt = (*priocntl_ptr)(PC_VERSION, P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
|
||||
rslt = priocntl(P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
|
||||
if (rslt < 0) return errno;
|
||||
assert(ClassInfo.pc_cid != -1, "cid for IA class is -1");
|
||||
iaLimits.schedPolicy = ClassInfo.pc_cid;
|
||||
@ -3949,7 +3745,7 @@ int lwp_priocntl_init ()
|
||||
|
||||
strcpy(ClassInfo.pc_clname, "RT");
|
||||
ClassInfo.pc_cid = -1;
|
||||
rslt = (*priocntl_ptr)(PC_VERSION, P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
|
||||
rslt = priocntl(P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
|
||||
if (rslt < 0) return errno;
|
||||
assert(ClassInfo.pc_cid != -1, "cid for RT class is -1");
|
||||
rtLimits.schedPolicy = ClassInfo.pc_cid;
|
||||
@ -3958,7 +3754,7 @@ int lwp_priocntl_init ()
|
||||
|
||||
strcpy(ClassInfo.pc_clname, "FX");
|
||||
ClassInfo.pc_cid = -1;
|
||||
rslt = (*priocntl_ptr)(PC_VERSION, P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
|
||||
rslt = priocntl(P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
|
||||
if (rslt < 0) return errno;
|
||||
assert(ClassInfo.pc_cid != -1, "cid for FX class is -1");
|
||||
fxLimits.schedPolicy = ClassInfo.pc_cid;
|
||||
@ -3969,7 +3765,7 @@ int lwp_priocntl_init ()
|
||||
// This will normally be IA, TS or, rarely, FX or RT.
|
||||
memset(&ParmInfo, 0, sizeof(ParmInfo));
|
||||
ParmInfo.pc_cid = PC_CLNULL;
|
||||
rslt = (*priocntl_ptr) (PC_VERSION, P_PID, P_MYID, PC_GETPARMS, (caddr_t)&ParmInfo);
|
||||
rslt = priocntl(P_PID, P_MYID, PC_GETPARMS, (caddr_t)&ParmInfo);
|
||||
if (rslt < 0) return errno;
|
||||
myClass = ParmInfo.pc_cid;
|
||||
|
||||
@ -3977,7 +3773,7 @@ int lwp_priocntl_init ()
|
||||
// about the class.
|
||||
ClassInfo.pc_cid = myClass;
|
||||
ClassInfo.pc_clname[0] = 0;
|
||||
rslt = (*priocntl_ptr) (PC_VERSION, (idtype)0, 0, PC_GETCLINFO, (caddr_t)&ClassInfo);
|
||||
rslt = priocntl((idtype)0, 0, PC_GETCLINFO, (caddr_t)&ClassInfo);
|
||||
if (rslt < 0) return errno;
|
||||
|
||||
if (ThreadPriorityVerbose) {
|
||||
@ -3986,7 +3782,7 @@ int lwp_priocntl_init ()
|
||||
|
||||
memset(&ParmInfo, 0, sizeof(pcparms_t));
|
||||
ParmInfo.pc_cid = PC_CLNULL;
|
||||
rslt = (*priocntl_ptr)(PC_VERSION, P_PID, P_MYID, PC_GETPARMS, (caddr_t)&ParmInfo);
|
||||
rslt = priocntl(P_PID, P_MYID, PC_GETPARMS, (caddr_t)&ParmInfo);
|
||||
if (rslt < 0) return errno;
|
||||
|
||||
if (ParmInfo.pc_cid == rtLimits.schedPolicy) {
|
||||
@ -4090,7 +3886,7 @@ int set_lwp_class_and_priority(int ThreadID, int lwpid,
|
||||
|
||||
memset(&ParmInfo, 0, sizeof(pcparms_t));
|
||||
ParmInfo.pc_cid = PC_CLNULL;
|
||||
rslt = (*priocntl_ptr)(PC_VERSION, P_LWPID, lwpid, PC_GETPARMS, (caddr_t)&ParmInfo);
|
||||
rslt = priocntl(P_LWPID, lwpid, PC_GETPARMS, (caddr_t)&ParmInfo);
|
||||
if (rslt < 0) return errno;
|
||||
|
||||
int cur_class = ParmInfo.pc_cid;
|
||||
@ -4158,7 +3954,7 @@ int set_lwp_class_and_priority(int ThreadID, int lwpid,
|
||||
return EINVAL; // no clue, punt
|
||||
}
|
||||
|
||||
rslt = (*priocntl_ptr)(PC_VERSION, P_LWPID, lwpid, PC_SETPARMS, (caddr_t)&ParmInfo);
|
||||
rslt = priocntl(P_LWPID, lwpid, PC_SETPARMS, (caddr_t)&ParmInfo);
|
||||
if (ThreadPriorityVerbose && rslt) {
|
||||
tty->print_cr ("PC_SETPARMS ->%d %d\n", rslt, errno);
|
||||
}
|
||||
@ -4177,7 +3973,7 @@ int set_lwp_class_and_priority(int ThreadID, int lwpid,
|
||||
|
||||
memset(&ReadBack, 0, sizeof(pcparms_t));
|
||||
ReadBack.pc_cid = PC_CLNULL;
|
||||
rslt = (*priocntl_ptr)(PC_VERSION, P_LWPID, lwpid, PC_GETPARMS, (caddr_t)&ReadBack);
|
||||
rslt = priocntl(P_LWPID, lwpid, PC_GETPARMS, (caddr_t)&ReadBack);
|
||||
assert(rslt >= 0, "priocntl failed");
|
||||
Actual = Expected = 0xBAD;
|
||||
assert(ParmInfo.pc_cid == ReadBack.pc_cid, "cid's don't match");
|
||||
@ -5269,11 +5065,6 @@ uint_t os::Solaris::getisax(uint32_t* array, uint_t n) {
|
||||
return _getisax(array, n);
|
||||
}
|
||||
|
||||
// Symbol doesn't exist in Solaris 8 pset.h
|
||||
#ifndef PS_MYID
|
||||
#define PS_MYID -3
|
||||
#endif
|
||||
|
||||
// int pset_getloadavg(psetid_t pset, double loadavg[], int nelem);
|
||||
typedef long (*pset_getloadavg_type)(psetid_t pset, double loadavg[], int nelem);
|
||||
static pset_getloadavg_type pset_getloadavg_ptr = NULL;
|
||||
@ -5443,20 +5234,6 @@ jint os::init_2(void) {
|
||||
UseNUMA = false;
|
||||
}
|
||||
}
|
||||
// ISM is not compatible with the NUMA allocator - it always allocates
|
||||
// pages round-robin across the lgroups.
|
||||
if (UseNUMA && UseLargePages && UseISM) {
|
||||
if (!FLAG_IS_DEFAULT(UseNUMA)) {
|
||||
if (FLAG_IS_DEFAULT(UseLargePages) && FLAG_IS_DEFAULT(UseISM)) {
|
||||
UseLargePages = false;
|
||||
} else {
|
||||
warning("UseNUMA is not compatible with ISM large pages, disabling NUMA allocator");
|
||||
UseNUMA = false;
|
||||
}
|
||||
} else {
|
||||
UseNUMA = false;
|
||||
}
|
||||
}
|
||||
if (!UseNUMA && ForceNUMA) {
|
||||
UseNUMA = true;
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ class Solaris {
|
||||
|
||||
static meminfo_func_t _meminfo;
|
||||
|
||||
// Large Page Support--mpss.
|
||||
static bool set_mpss_range(caddr_t start, size_t bytes, size_t align);
|
||||
// Large Page Support
|
||||
static bool setup_large_pages(caddr_t start, size_t bytes, size_t align);
|
||||
|
||||
static void init_thread_fpu_state(void);
|
||||
|
||||
@ -174,7 +174,6 @@ class Solaris {
|
||||
static char* mmap_chunk(char *addr, size_t size, int flags, int prot);
|
||||
static char* anon_mmap(char* requested_addr, size_t bytes, size_t alignment_hint, bool fixed);
|
||||
static bool mpss_sanity_check(bool warn, size_t * page_size);
|
||||
static bool ism_sanity_check (bool warn, size_t * page_size);
|
||||
|
||||
// Workaround for 4352906. thr_stksegment sometimes returns
|
||||
// a bad value for the primordial thread's stack base when
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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
|
||||
@ -146,7 +146,7 @@ public:
|
||||
// Public Methods
|
||||
Form(int formType=0, int line=0)
|
||||
: _next(NULL), _linenum(line), _ftype(formType) { };
|
||||
~Form() {};
|
||||
virtual ~Form() {};
|
||||
|
||||
virtual bool ideal_only() const {
|
||||
assert(0,"Check of ideal status on non-instruction/operand form.\n");
|
||||
|
@ -260,6 +260,9 @@ static ObsoleteFlag obsolete_jvm_flags[] = {
|
||||
{ "PrintRevisitStats", JDK_Version::jdk(8), JDK_Version::jdk(9) },
|
||||
{ "UseVectoredExceptions", JDK_Version::jdk(8), JDK_Version::jdk(9) },
|
||||
{ "UseSplitVerifier", JDK_Version::jdk(8), JDK_Version::jdk(9) },
|
||||
{ "UseISM", JDK_Version::jdk(8), JDK_Version::jdk(9) },
|
||||
{ "UsePermISM", JDK_Version::jdk(8), JDK_Version::jdk(9) },
|
||||
{ "UseMPSS", JDK_Version::jdk(8), JDK_Version::jdk(9) },
|
||||
#ifdef PRODUCT
|
||||
{ "DesiredMethodLimit",
|
||||
JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
|
||||
@ -1854,8 +1857,13 @@ bool Arguments::check_gc_consistency() {
|
||||
"please refer to the release notes for the combinations "
|
||||
"allowed\n");
|
||||
status = false;
|
||||
} else if (ReservedCodeCacheSize > 2*G) {
|
||||
// Code cache size larger than MAXINT is not supported.
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
|
||||
(2*G)/M);
|
||||
status = false;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -2221,8 +2229,13 @@ bool Arguments::check_vm_args_consistency() {
|
||||
"Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K,
|
||||
min_code_cache_size/K);
|
||||
status = false;
|
||||
} else if (ReservedCodeCacheSize > 2*G) {
|
||||
// Code cache size larger than MAXINT is not supported.
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
|
||||
(2*G)/M);
|
||||
status = false;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -2936,13 +2949,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
FLAG_SET_CMDLINE(bool, UseTLAB, true);
|
||||
} else if (match_option(option, "-XX:-UseTLE", &tail)) {
|
||||
FLAG_SET_CMDLINE(bool, UseTLAB, false);
|
||||
SOLARIS_ONLY(
|
||||
} else if (match_option(option, "-XX:+UsePermISM", &tail)) {
|
||||
warning("-XX:+UsePermISM is obsolete.");
|
||||
FLAG_SET_CMDLINE(bool, UseISM, true);
|
||||
} else if (match_option(option, "-XX:-UsePermISM", &tail)) {
|
||||
FLAG_SET_CMDLINE(bool, UseISM, false);
|
||||
)
|
||||
} else if (match_option(option, "-XX:+DisplayVMOutputToStderr", &tail)) {
|
||||
FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, false);
|
||||
FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, true);
|
||||
@ -3115,8 +3121,6 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req
|
||||
// Note that large pages are enabled/disabled for both the
|
||||
// Java heap and the code cache.
|
||||
FLAG_SET_DEFAULT(UseLargePages, false);
|
||||
SOLARIS_ONLY(FLAG_SET_DEFAULT(UseMPSS, false));
|
||||
SOLARIS_ONLY(FLAG_SET_DEFAULT(UseISM, false));
|
||||
}
|
||||
|
||||
// Tiered compilation is undefined with C1.
|
||||
|
@ -175,6 +175,7 @@ define_pd_global(intx, InitialCodeCacheSize, 160*K);
|
||||
define_pd_global(intx, ReservedCodeCacheSize, 32*M);
|
||||
define_pd_global(intx, CodeCacheExpansionSize, 32*K);
|
||||
define_pd_global(intx, CodeCacheMinBlockLength, 1);
|
||||
define_pd_global(intx, CodeCacheMinimumUseSpace, 200*K);
|
||||
define_pd_global(uintx,MetaspaceSize, ScaleForWordSize(4*M));
|
||||
define_pd_global(bool, NeverActAsServerClassMachine, true);
|
||||
define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
|
@ -15,7 +15,7 @@
|
||||
* @bug 8005956
|
||||
* @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
|
||||
*
|
||||
* @run main PolynomialRoot
|
||||
* @run main/timeout=300 PolynomialRoot
|
||||
*/
|
||||
|
||||
public class PolynomialRoot {
|
||||
@ -757,19 +757,26 @@ public static int root4(final double [] p,final double [] re_root,final double [
|
||||
|
||||
public static void main(final String [] args)
|
||||
{
|
||||
final long t0=System.currentTimeMillis();
|
||||
final double eps=1e-6;
|
||||
//checkRoots();
|
||||
final java.util.Random r=new java.util.Random(-1381923);
|
||||
printSpecialValues();
|
||||
if (System.getProperty("os.arch").equals("x86") ||
|
||||
System.getProperty("os.arch").equals("amd64") ||
|
||||
System.getProperty("os.arch").equals("x86_64")){
|
||||
final long t0=System.currentTimeMillis();
|
||||
final double eps=1e-6;
|
||||
//checkRoots();
|
||||
final java.util.Random r=new java.util.Random(-1381923);
|
||||
printSpecialValues();
|
||||
|
||||
final int n_tests=10000000;
|
||||
//testRoots(2,n_tests,r,eps);
|
||||
//testRoots(3,n_tests,r,eps);
|
||||
testRoots(4,n_tests,r,eps);
|
||||
final long t1=System.currentTimeMillis();
|
||||
System.err.println("PolynomialRoot.main: "+n_tests+" tests OK done in "+(t1-t0)+" milliseconds. ver=$Id: PolynomialRoot.java,v 1.105 2012/08/18 00:00:05 mal Exp $");
|
||||
}
|
||||
final int n_tests=100000;
|
||||
//testRoots(2,n_tests,r,eps);
|
||||
//testRoots(3,n_tests,r,eps);
|
||||
testRoots(4,n_tests,r,eps);
|
||||
final long t1=System.currentTimeMillis();
|
||||
System.err.println("PolynomialRoot.main: "+n_tests+" tests OK done in "+(t1-t0)+" milliseconds. ver=$Id: PolynomialRoot.java,v 1.105 2012/08/18 00:00:05 mal Exp $");
|
||||
System.out.println("PASSED");
|
||||
} else {
|
||||
System.out.println("PASS test for non-x86");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
47
hotspot/test/compiler/codecache/CheckUpperLimit.java
Normal file
47
hotspot/test/compiler/codecache/CheckUpperLimit.java
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8015635
|
||||
* @summary Test ensures that the ReservedCodeCacheSize is at most MAXINT
|
||||
* @library /testlibrary
|
||||
*
|
||||
*/
|
||||
import com.oracle.java.testlibrary.*;
|
||||
|
||||
public class CheckUpperLimit {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2048m", "-version");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldHaveExitValue(0);
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldContain("Invalid ReservedCodeCacheSize=");
|
||||
out.shouldHaveExitValue(1);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user