summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2007-09-20 03:35:30 +0000
committerGreg Lewis <glewis@FreeBSD.org>2007-09-20 03:35:30 +0000
commit260ffa12c0f108eb67999015df3fe0328aec4e3d (patch)
tree70d3a17af379c40502057ac848174b70d764b447 /java
parentThere's a whole bunch of class builders out there. In fact, creating a (diff)
. Default UseThreadPriorities to false on BSD. This can be toggled by
passing -XX:+UseThreadPriorities. . Remove the os_sleep hack which was used on FreeBSD to make sure lower priority threads got time slices. Instead, just call pthread_yield(). On FreeBSD 7.x with libthr, this will still give lower priority threads some time (with the above flag turned on), although such behaviour is not guaranteed by POSIX. This boosts FreeBSD performance by 7-fold on an 8 core system, putting it on a par with Solaris (benchmarks by kris@). The Java standard and the JCK tests are somewhat contradictory on thread priority being guaranteed to work, and in this case the performance benefits appear to outweigh any possible side effects. . Pick up DEFAULT_LD_LIBRARY_PATH from the build environment rather than patching it into a file at build time. This simplifies the Makefile. Submitted by: Kurt Miller <kurt@intricatesoftware.com>
Notes
Notes: svn path=/head/; revision=199806
Diffstat (limited to 'java')
-rw-r--r--java/jdk15/Makefile8
-rw-r--r--java/jdk15/files/patch-vm::globals.hpp26
-rw-r--r--java/jdk15/files/patch-vm::os_bsd.cpp43
3 files changed, 59 insertions, 18 deletions
diff --git a/java/jdk15/Makefile b/java/jdk15/Makefile
index 9d964b96c643..1186d508af2b 100644
--- a/java/jdk15/Makefile
+++ b/java/jdk15/Makefile
@@ -7,7 +7,7 @@
PORTNAME= jdk
PORTVERSION= ${JDK_VERSION}.${JDK_UPDATE_VERSION}p${JDK_PATCHSET_VERSION}
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= java devel
MASTER_SITES= # http://download.java.net/tiger/
@@ -129,6 +129,7 @@ NO_CDROM= "Redistribution of pre-compiled binaries is not permitted"
MAKE_ENV+= ALT_BOOTDIR="${BOOTSTRAPJDKDIR}" \
ALT_MOTIF_DIR="${X11BASE}" \
+ DEFAULT_LD_LIBRARY_PATH="/usr/lib:${LOCALBASE}/lib" \
SYS_CFLAGS="${CFLAGS}" \
LANG="C" \
JAVA_HOME="" \
@@ -161,7 +162,6 @@ HOTSPOTARCH=i586
JDKIMAGEDIR= ${WRKSRC}/../build/bsd-${HOTSPOTARCH}/j2sdk-image
JDKIMAGEDIR_G= ${WRKSRC}/../build/bsd-${HOTSPOTARCH}/j2sdk-debug-image
-LOCAL_FILES= ../../hotspot/src/os/bsd/vm/os_bsd.cpp
PTHREAD_FILES= ../../hotspot/build/bsd/makefiles/vm.make \
../../j2se/make/com/sun/java/pack/Makefile \
../../j2se/make/common/Defs.gmk \
@@ -265,10 +265,6 @@ pre-patch:
.endif
post-patch:
- @for file in ${LOCAL_FILES}; do \
- ${REINPLACE_CMD} -e "s:%%LOCALBASE%%:${LOCALBASE}:" \
- ${WRKSRC}/$${file}; \
- done
@for file in ${PTHREAD_FILES}; do \
${REINPLACE_CMD} -e "s:-pthread:${PTHREAD_LIBS}:g" \
${WRKSRC}/$${file}; \
diff --git a/java/jdk15/files/patch-vm::globals.hpp b/java/jdk15/files/patch-vm::globals.hpp
new file mode 100644
index 000000000000..04d6c38413ed
--- /dev/null
+++ b/java/jdk15/files/patch-vm::globals.hpp
@@ -0,0 +1,26 @@
+$FreeBSD$
+
+--- ../../hotspot/src/share/vm/runtime/globals.hpp.orig Wed May 2 04:01:50 2007
++++ ../../hotspot/src/share/vm/runtime/globals.hpp Tue Sep 18 21:40:44 2007
+@@ -130,6 +130,12 @@
+ #define falseInProduct true
+ #endif
+
++#if defined(_ALLBSD_SOURCE)
++#define OSUseThreadPriorities false
++#else
++#define OSUseThreadPriorities true
++#endif
++
+ // develop flags are settable / visible only during development and are constant in the PRODUCT version
+ // product flags are always settable / visible
+
+@@ -2546,7 +2552,7 @@
+ "beginning to throw OutOfMemoryErrors in each compile") \
+ \
+ /* Priorities */ \
+- product(bool, UseThreadPriorities, true, \
++ product(bool, UseThreadPriorities, OSUseThreadPriorities, \
+ "Use native thread priorities") \
+ \
+ product(intx, ThreadPriorityPolicy, 0, \
diff --git a/java/jdk15/files/patch-vm::os_bsd.cpp b/java/jdk15/files/patch-vm::os_bsd.cpp
index 1add61fe9496..fc7bbfd757f0 100644
--- a/java/jdk15/files/patch-vm::os_bsd.cpp
+++ b/java/jdk15/files/patch-vm::os_bsd.cpp
@@ -1,13 +1,32 @@
$FreeBSD$
-
---- ../../hotspot/src/os/bsd/vm/os_bsd.cpp Sun Jun 3 18:46:31 2007
-+++ ../../hotspot/src/os/bsd/vm/os_bsd.cpp.orig Sun Jun 3 18:47:28 2007
-@@ -499,7 +499,7 @@
- #define getenv(n) ::getenv(n)
-
- #ifndef DEFAULT_LD_LIBRARY_PATH
--#define DEFAULT_LD_LIBRARY_PATH "/usr/lib" /* See ld.so.1(1) */
-+#define DEFAULT_LD_LIBRARY_PATH "/usr/lib:%%LOCALBASE%%/lib" /* See ld.so.1(1) */
- #endif
- #define EXTENSIONS_DIR "/lib/ext"
- #define ENDORSED_DIR "/lib/endorsed"
+
+--- ../../hotspot/src/os/bsd/vm/os_bsd.cpp.orig Mon Sep 17 21:03:04 2007
++++ ../../hotspot/src/os/bsd/vm/os_bsd.cpp Tue Sep 18 21:36:51 2007
+@@ -2271,13 +2271,7 @@
+ if (thread->is_Java_thread()) {
+ ThreadBlockInVM tbivm((JavaThread*) thread);
+
+-// BSDXXX: Only use pthread_yield here and below if the system thread
+-// scheduler gives time slices to lower priority threads when yielding.
+-#ifdef __FreeBSD__
+- os_sleep(MinSleepInterval, interruptible);
+-#else
+ pthread_yield();
+-#endif
+
+ #if SOLARIS
+ // XXX - This code was not exercised during the Merlin RC1
+@@ -2297,13 +2291,7 @@
+ return 0;
+ }
+
+-// BSDXXX: Only use pthread_yield here and above if the system thread
+-// scheduler gives time slices to lower priority threads when yielding.
+-#ifdef __FreeBSD__
+- os_sleep(MinSleepInterval, interruptible);
+-#else
+ pthread_yield();
+-#endif
+ return 0;
+ }
+