342 } 343 344 julong os::Solaris::_physical_memory = 0; 345 346 julong os::physical_memory() { 347 return Solaris::physical_memory(); 348 } 349 350 static hrtime_t first_hrtime = 0; 351 static const hrtime_t hrtime_hz = 1000*1000*1000; 352 static volatile hrtime_t max_hrtime = 0; 353 354 355 void os::Solaris::initialize_system_info() { 356 set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); 357 _processors_online = sysconf (_SC_NPROCESSORS_ONLN); 358 _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); 359 } 360 361 int os::active_processor_count() { 362 int online_cpus = sysconf(_SC_NPROCESSORS_ONLN); 363 pid_t pid = getpid(); 364 psetid_t pset = PS_NONE; 365 // Are we running in a processor set or is there any processor set around? 366 if (pset_bind(PS_QUERY, P_PID, pid, &pset) == 0) { 367 uint_t pset_cpus; 368 // Query the number of cpus available to us. 369 if (pset_info(pset, NULL, &pset_cpus, NULL) == 0) { 370 assert(pset_cpus > 0 && pset_cpus <= online_cpus, "sanity check"); 371 _processors_online = pset_cpus; 372 return pset_cpus; 373 } 374 } 375 // Otherwise return number of online cpus 376 return online_cpus; 377 } 378 379 static bool find_processors_in_pset(psetid_t pset, 380 processorid_t** id_array, 381 uint_t* id_length) { | 342 } 343 344 julong os::Solaris::_physical_memory = 0; 345 346 julong os::physical_memory() { 347 return Solaris::physical_memory(); 348 } 349 350 static hrtime_t first_hrtime = 0; 351 static const hrtime_t hrtime_hz = 1000*1000*1000; 352 static volatile hrtime_t max_hrtime = 0; 353 354 355 void os::Solaris::initialize_system_info() { 356 set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); 357 _processors_online = sysconf (_SC_NPROCESSORS_ONLN); 358 _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); 359 } 360 361 int os::active_processor_count() { 362 // User has overridden the number of active processors 363 if (ActiveProcessorCount > 0) { 364 if (Verbose) { 365 tty->print_cr("active_processor_count: " 366 "active processor count set by user : %d", 367 ActiveProcessorCount); 368 } 369 return ActiveProcessorCount; 370 } 371 372 int online_cpus = sysconf(_SC_NPROCESSORS_ONLN); 373 pid_t pid = getpid(); 374 psetid_t pset = PS_NONE; 375 // Are we running in a processor set or is there any processor set around? 376 if (pset_bind(PS_QUERY, P_PID, pid, &pset) == 0) { 377 uint_t pset_cpus; 378 // Query the number of cpus available to us. 379 if (pset_info(pset, NULL, &pset_cpus, NULL) == 0) { 380 assert(pset_cpus > 0 && pset_cpus <= online_cpus, "sanity check"); 381 _processors_online = pset_cpus; 382 return pset_cpus; 383 } 384 } 385 // Otherwise return number of online cpus 386 return online_cpus; 387 } 388 389 static bool find_processors_in_pset(psetid_t pset, 390 processorid_t** id_array, 391 uint_t* id_length) { |