274 275 julong os::Solaris::_physical_memory = 0; 276 277 julong os::physical_memory() { 278 return Solaris::physical_memory(); 279 } 280 281 static hrtime_t first_hrtime = 0; 282 static const hrtime_t hrtime_hz = 1000*1000*1000; 283 static volatile hrtime_t max_hrtime = 0; 284 285 286 void os::Solaris::initialize_system_info() { 287 set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); 288 _processors_online = sysconf(_SC_NPROCESSORS_ONLN); 289 _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * 290 (julong)sysconf(_SC_PAGESIZE); 291 } 292 293 int os::active_processor_count() { 294 int online_cpus = sysconf(_SC_NPROCESSORS_ONLN); 295 pid_t pid = getpid(); 296 psetid_t pset = PS_NONE; 297 // Are we running in a processor set or is there any processor set around? 298 if (pset_bind(PS_QUERY, P_PID, pid, &pset) == 0) { 299 uint_t pset_cpus; 300 // Query the number of cpus available to us. 301 if (pset_info(pset, NULL, &pset_cpus, NULL) == 0) { 302 assert(pset_cpus > 0 && pset_cpus <= online_cpus, "sanity check"); 303 _processors_online = pset_cpus; 304 return pset_cpus; 305 } 306 } 307 // Otherwise return number of online cpus 308 return online_cpus; 309 } 310 311 static bool find_processors_in_pset(psetid_t pset, 312 processorid_t** id_array, 313 uint_t* id_length) { | 274 275 julong os::Solaris::_physical_memory = 0; 276 277 julong os::physical_memory() { 278 return Solaris::physical_memory(); 279 } 280 281 static hrtime_t first_hrtime = 0; 282 static const hrtime_t hrtime_hz = 1000*1000*1000; 283 static volatile hrtime_t max_hrtime = 0; 284 285 286 void os::Solaris::initialize_system_info() { 287 set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); 288 _processors_online = sysconf(_SC_NPROCESSORS_ONLN); 289 _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * 290 (julong)sysconf(_SC_PAGESIZE); 291 } 292 293 int os::active_processor_count() { 294 // User has overridden the number of active processors 295 if (ActiveProcessorCount > 0) { 296 log_trace(os)("active_processor_count: " 297 "active processor count set by user : %d", 298 (int)ActiveProcessorCount); 299 return ActiveProcessorCount; 300 } 301 302 int online_cpus = sysconf(_SC_NPROCESSORS_ONLN); 303 pid_t pid = getpid(); 304 psetid_t pset = PS_NONE; 305 // Are we running in a processor set or is there any processor set around? 306 if (pset_bind(PS_QUERY, P_PID, pid, &pset) == 0) { 307 uint_t pset_cpus; 308 // Query the number of cpus available to us. 309 if (pset_info(pset, NULL, &pset_cpus, NULL) == 0) { 310 assert(pset_cpus > 0 && pset_cpus <= online_cpus, "sanity check"); 311 _processors_online = pset_cpus; 312 return pset_cpus; 313 } 314 } 315 // Otherwise return number of online cpus 316 return online_cpus; 317 } 318 319 static bool find_processors_in_pset(psetid_t pset, 320 processorid_t** id_array, 321 uint_t* id_length) { |