mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 05:45:11 +02:00
7082553: Interpret Thread.setPriority(Thread.MAX_PRIORITY) to mean FX60 on Solaris 10 and 11
Add CriticalPriority == MaxPriority+1 and enable scheduling class as well as thread priority to change on Solaris. Reviewed-by: dholmes, dcubed
This commit is contained in:
parent
7ece654913
commit
09e21afaaa
9 changed files with 289 additions and 140 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2012, 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
|
||||
|
@ -855,23 +855,23 @@ CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQue
|
|||
// Note that this only sets the JavaThread _priority field, which by
|
||||
// definition is limited to Java priorities and not OS priorities.
|
||||
// The os-priority is set in the CompilerThread startup code itself
|
||||
|
||||
java_lang_Thread::set_priority(thread_oop(), NearMaxPriority);
|
||||
// CLEANUP PRIORITIES: This -if- statement hids a bug whereby the compiler
|
||||
// threads never have their OS priority set. The assumption here is to
|
||||
// enable the Performance group to do flag tuning, figure out a suitable
|
||||
// CompilerThreadPriority, and then remove this 'if' statement (and
|
||||
// comment) and unconditionally set the priority.
|
||||
|
||||
// Compiler Threads should be at the highest Priority
|
||||
if ( CompilerThreadPriority != -1 )
|
||||
os::set_native_priority( compiler_thread, CompilerThreadPriority );
|
||||
else
|
||||
os::set_native_priority( compiler_thread, os::java_to_os_priority[NearMaxPriority]);
|
||||
// Note that we cannot call os::set_priority because it expects Java
|
||||
// priorities and we are *explicitly* using OS priorities so that it's
|
||||
// possible to set the compiler thread priority higher than any Java
|
||||
// thread.
|
||||
|
||||
// Note that I cannot call os::set_priority because it expects Java
|
||||
// priorities and I am *explicitly* using OS priorities so that it's
|
||||
// possible to set the compiler thread priority higher than any Java
|
||||
// thread.
|
||||
int native_prio = CompilerThreadPriority;
|
||||
if (native_prio == -1) {
|
||||
if (UseCriticalCompilerThreadPriority) {
|
||||
native_prio = os::java_to_os_priority[CriticalPriority];
|
||||
} else {
|
||||
native_prio = os::java_to_os_priority[NearMaxPriority];
|
||||
}
|
||||
}
|
||||
os::set_native_priority(compiler_thread, native_prio);
|
||||
|
||||
java_lang_Thread::set_daemon(thread_oop());
|
||||
|
||||
|
@ -879,6 +879,7 @@ CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQue
|
|||
Threads::add(compiler_thread);
|
||||
Thread::start(compiler_thread);
|
||||
}
|
||||
|
||||
// Let go of Threads_lock before yielding
|
||||
os::yield(); // make sure that the compiler thread is started early (especially helpful on SOLARIS)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue