1.1 --- a/common/autoconf/generated-configure.sh Thu Feb 28 20:29:19 2013 -0800 1.2 +++ b/common/autoconf/generated-configure.sh Mon Mar 04 16:45:07 2013 +0100 1.3 @@ -601,8 +601,8 @@ 1.4 ENABLE_SJAVAC 1.5 SJAVAC_SERVER_CORES 1.6 SJAVAC_SERVER_JAVA 1.7 +JOBS 1.8 MEMORY_SIZE 1.9 -CONCURRENT_BUILD_JOBS 1.10 NUM_CORES 1.11 SALIB_NAME 1.12 HOTSPOT_MAKE_ARGS 1.13 @@ -1002,6 +1002,7 @@ 1.14 with_stdc__lib 1.15 with_num_cores 1.16 with_memory_size 1.17 +with_jobs 1.18 with_sjavac_server_java 1.19 with_sjavac_server_cores 1.20 enable_sjavac 1.21 @@ -1760,6 +1761,8 @@ 1.22 --with-num-cores=8 [probed] 1.23 --with-memory-size memory (in MB) available in the build system, e.g. 1.24 --with-memory-size=1024 [probed] 1.25 + --with-jobs number of parallel jobs to let make run [calculated 1.26 + based on cores and memory] 1.27 --with-sjavac-server-java 1.28 use this java binary for running the sjavac 1.29 background server [Boot JDK java] 1.30 @@ -3329,6 +3332,8 @@ 1.31 1.32 1.33 1.34 + 1.35 + 1.36 # 1.37 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 1.38 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.39 @@ -3724,7 +3729,7 @@ 1.40 #CUSTOM_AUTOCONF_INCLUDE 1.41 1.42 # Do not change or remove the following line, it is needed for consistency checks: 1.43 -DATE_WHEN_GENERATED=1361452590 1.44 +DATE_WHEN_GENERATED=1362411827 1.45 1.46 ############################################################################### 1.47 # 1.48 @@ -31225,14 +31230,14 @@ 1.49 ############################################################################### 1.50 1.51 1.52 -# How many cores do we have on this build system? 1.53 + # How many cores do we have on this build system? 1.54 1.55 # Check whether --with-num-cores was given. 1.56 if test "${with_num_cores+set}" = set; then : 1.57 withval=$with_num_cores; 1.58 fi 1.59 1.60 -if test "x$with_num_cores" = x; then 1.61 + if test "x$with_num_cores" = x; then 1.62 # The number of cores were not specified, try to probe them. 1.63 1.64 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for number of cores" >&5 1.65 @@ -31258,10 +31263,6 @@ 1.66 FOUND_CORES=yes 1.67 fi 1.68 1.69 - # For c/c++ code we run twice as many concurrent build 1.70 - # jobs than we have cores, otherwise we will stall on io. 1.71 - CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2` 1.72 - 1.73 if test "x$FOUND_CORES" = xyes; then 1.74 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUM_CORES" >&5 1.75 $as_echo "$NUM_CORES" >&6; } 1.76 @@ -31273,22 +31274,20 @@ 1.77 fi 1.78 1.79 1.80 -else 1.81 + else 1.82 NUM_CORES=$with_num_cores 1.83 - CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2` 1.84 -fi 1.85 - 1.86 - 1.87 - 1.88 - 1.89 -# How much memory do we have on this build system? 1.90 + fi 1.91 + 1.92 + 1.93 + 1.94 + # How much memory do we have on this build system? 1.95 1.96 # Check whether --with-memory-size was given. 1.97 if test "${with_memory_size+set}" = set; then : 1.98 withval=$with_memory_size; 1.99 fi 1.100 1.101 -if test "x$with_memory_size" = x; then 1.102 + if test "x$with_memory_size" = x; then 1.103 # The memory size was not specified, try to probe it. 1.104 1.105 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for memory size" >&5 1.106 @@ -31328,9 +31327,45 @@ 1.107 $as_echo "$as_me: WARNING: This might seriously impact build performance!" >&2;} 1.108 fi 1.109 1.110 -else 1.111 + else 1.112 MEMORY_SIZE=$with_memory_size 1.113 -fi 1.114 + fi 1.115 + 1.116 + 1.117 + 1.118 + # Provide a decent default number of parallel jobs for make depending on 1.119 + # number of cores, amount of memory and machine architecture. 1.120 + 1.121 +# Check whether --with-jobs was given. 1.122 +if test "${with_jobs+set}" = set; then : 1.123 + withval=$with_jobs; 1.124 +fi 1.125 + 1.126 + if test "x$with_jobs" = x; then 1.127 + # Number of jobs was not specified, calculate. 1.128 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for appropriate number of jobs to run in parallel" >&5 1.129 +$as_echo_n "checking for appropriate number of jobs to run in parallel... " >&6; } 1.130 + # Approximate memory in GB, rounding up a bit. 1.131 + memory_gb=`expr $MEMORY_SIZE / 1100` 1.132 + # Pick the lowest of memory in gb and number of cores. 1.133 + if test "$memory_gb" -lt "$NUM_CORES"; then 1.134 + JOBS="$memory_gb" 1.135 + else 1.136 + JOBS="$NUM_CORES" 1.137 + # On bigger machines, leave some room for other processes to run 1.138 + if test "$JOBS" -gt "4"; then 1.139 + JOBS=`expr $JOBS '*' 90 / 100` 1.140 + fi 1.141 + fi 1.142 + # Cap number of jobs to 16 1.143 + if test "$JOBS" -gt "16"; then 1.144 + JOBS=16 1.145 + fi 1.146 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JOBS" >&5 1.147 +$as_echo "$JOBS" >&6; } 1.148 + else 1.149 + JOBS=$with_jobs 1.150 + fi 1.151 1.152 1.153 1.154 @@ -33143,7 +33178,7 @@ 1.155 1.156 printf "\n" 1.157 printf "Build performance summary:\n" 1.158 -printf "* Cores to use: $NUM_CORES\n" 1.159 +printf "* Cores to use: $JOBS\n" 1.160 printf "* Memory limit: $MEMORY_SIZE MB\n" 1.161 printf "* ccache status: $CCACHE_STATUS\n" 1.162 printf "\n"