1 /* |
1 /* |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
76 address os::_polling_page = NULL; |
76 address os::_polling_page = NULL; |
77 volatile int32_t* os::_mem_serialize_page = NULL; |
77 volatile int32_t* os::_mem_serialize_page = NULL; |
78 uintptr_t os::_serialize_page_mask = 0; |
78 uintptr_t os::_serialize_page_mask = 0; |
79 long os::_rand_seed = 1; |
79 long os::_rand_seed = 1; |
80 int os::_processor_count = 0; |
80 int os::_processor_count = 0; |
|
81 int os::_initial_active_processor_count = 0; |
81 size_t os::_page_sizes[os::page_sizes_max]; |
82 size_t os::_page_sizes[os::page_sizes_max]; |
82 |
83 |
83 #ifndef PRODUCT |
84 #ifndef PRODUCT |
84 julong os::num_mallocs = 0; // # of calls to malloc/realloc |
85 julong os::num_mallocs = 0; // # of calls to malloc/realloc |
85 julong os::alloc_bytes = 0; // # of bytes allocated |
86 julong os::alloc_bytes = 0; // # of bytes allocated |
320 } |
321 } |
321 } |
322 } |
322 } |
323 } |
323 |
324 |
324 void os::init_before_ergo() { |
325 void os::init_before_ergo() { |
|
326 initialize_initial_active_processor_count(); |
325 // We need to initialize large page support here because ergonomics takes some |
327 // We need to initialize large page support here because ergonomics takes some |
326 // decisions depending on large page support and the calculated large page size. |
328 // decisions depending on large page support and the calculated large page size. |
327 large_page_init(); |
329 large_page_init(); |
328 |
330 |
329 // VM version initialization identifies some characteristics of the |
331 // VM version initialization identifies some characteristics of the |
833 void os::print_cpu_info(outputStream* st) { |
835 void os::print_cpu_info(outputStream* st) { |
834 // cpu |
836 // cpu |
835 st->print("CPU:"); |
837 st->print("CPU:"); |
836 st->print("total %d", os::processor_count()); |
838 st->print("total %d", os::processor_count()); |
837 // It's not safe to query number of active processors after crash |
839 // It's not safe to query number of active processors after crash |
838 // st->print("(active %d)", os::active_processor_count()); |
840 // st->print("(active %d)", os::active_processor_count()); but we can |
|
841 // print the initial number of active processors. |
|
842 // We access the raw value here because the assert in the accessor will |
|
843 // fail if the crash occurs before initialization of this value. |
|
844 st->print(" (initial active %d)", _initial_active_processor_count); |
839 st->print(" %s", VM_Version::cpu_features()); |
845 st->print(" %s", VM_Version::cpu_features()); |
840 st->cr(); |
846 st->cr(); |
841 pd_print_cpu_info(st); |
847 pd_print_cpu_info(st); |
842 } |
848 } |
843 |
849 |