1 /*
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
3917 jint os::init_2(void) {
3918 // try to enable extended file IO ASAP, see 6431278
3919 os::Solaris::try_enable_extended_io();
3920
3921 // Check and sets minimum stack sizes against command line options
3922 if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
3923 return JNI_ERR;
3924 }
3925
3926 Solaris::libthread_init();
3927
3928 if (UseNUMA) {
3929 if (!Solaris::liblgrp_init()) {
3930 UseNUMA = false;
3931 } else {
3932 size_t lgrp_limit = os::numa_get_groups_num();
3933 int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit, mtInternal);
3934 size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
3935 FREE_C_HEAP_ARRAY(int, lgrp_ids);
3936 if (lgrp_num < 2) {
3937 // There's only one locality group, disable NUMA.
3938 UseNUMA = false;
3939 }
3940 }
3941 if (!UseNUMA && ForceNUMA) {
3942 UseNUMA = true;
3943 }
3944 }
3945
3946 Solaris::signal_sets_init();
3947 Solaris::init_signal_mem();
3948 Solaris::install_signal_handlers();
3949 // Initialize data for jdk.internal.misc.Signal
3950 if (!ReduceSignalUsage) {
3951 jdk_misc_signal_init();
3952 }
3953
3954 // initialize synchronization primitives to use either thread or
3955 // lwp synchronization (controlled by UseLWPSynchronization)
3956 Solaris::synchronization_init();
3957 DEBUG_ONLY(os::set_mutex_init_done();)
3958
3959 if (MaxFDLimit) {
3960 // set the number of file descriptors to max. print out error
3961 // if getrlimit/setrlimit fails but continue regardless.
3962 struct rlimit nbr_files;
|
1 /*
2 * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
3917 jint os::init_2(void) {
3918 // try to enable extended file IO ASAP, see 6431278
3919 os::Solaris::try_enable_extended_io();
3920
3921 // Check and sets minimum stack sizes against command line options
3922 if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
3923 return JNI_ERR;
3924 }
3925
3926 Solaris::libthread_init();
3927
3928 if (UseNUMA) {
3929 if (!Solaris::liblgrp_init()) {
3930 UseNUMA = false;
3931 } else {
3932 size_t lgrp_limit = os::numa_get_groups_num();
3933 int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit, mtInternal);
3934 size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
3935 FREE_C_HEAP_ARRAY(int, lgrp_ids);
3936 if (lgrp_num < 2) {
3937 // There's only one locality group, disable NUMA unless
3938 // user explicilty forces NUMA optimizations on single-node/UMA systems
3939 UseNUMA = ForceNUMA;
3940 }
3941 }
3942 }
3943
3944 Solaris::signal_sets_init();
3945 Solaris::init_signal_mem();
3946 Solaris::install_signal_handlers();
3947 // Initialize data for jdk.internal.misc.Signal
3948 if (!ReduceSignalUsage) {
3949 jdk_misc_signal_init();
3950 }
3951
3952 // initialize synchronization primitives to use either thread or
3953 // lwp synchronization (controlled by UseLWPSynchronization)
3954 Solaris::synchronization_init();
3955 DEBUG_ONLY(os::set_mutex_init_done();)
3956
3957 if (MaxFDLimit) {
3958 // set the number of file descriptors to max. print out error
3959 // if getrlimit/setrlimit fails but continue regardless.
3960 struct rlimit nbr_files;
|