# HG changeset patch # User xlu # Date 1223318374 25200 # Node ID fad66fdcb7fcba202b18caadab26597cb6054bab # Parent f1ecf9191140e1f06fb0608a741fbfe788bd8d86 6673124: Runtime.availableProcessors / os::active_processor_count wrong if unused processor sets exist Reviewed-by: acorn, dholmes diff -r f1ecf9191140 -r fad66fdcb7fc src/os/solaris/vm/os_solaris.cpp --- a/src/os/solaris/vm/os_solaris.cpp Thu Oct 02 14:11:33 2008 -0700 +++ b/src/os/solaris/vm/os_solaris.cpp Mon Oct 06 11:39:34 2008 -0700 @@ -462,16 +462,14 @@ int online_cpus = sysconf(_SC_NPROCESSORS_ONLN); pid_t pid = getpid(); psetid_t pset = PS_NONE; - // Are we running in a processor set? + // Are we running in a processor set or is there any processor set around? if (pset_bind(PS_QUERY, P_PID, pid, &pset) == 0) { - if (pset != PS_NONE) { - uint_t pset_cpus; - // Query number of cpus in processor set - if (pset_info(pset, NULL, &pset_cpus, NULL) == 0) { - assert(pset_cpus > 0 && pset_cpus <= online_cpus, "sanity check"); - _processors_online = pset_cpus; - return pset_cpus; - } + uint_t pset_cpus; + // Query the number of cpus available to us. + if (pset_info(pset, NULL, &pset_cpus, NULL) == 0) { + assert(pset_cpus > 0 && pset_cpus <= online_cpus, "sanity check"); + _processors_online = pset_cpus; + return pset_cpus; } } // Otherwise return number of online cpus