# HG changeset patch # User Andrew John Hughes # Date 1268272313 0 # Node ID 373dcdea587164ff50ab25a141bc22e113b1eb3d # Parent 29c75d7fc03a3b6226cf1b53204dff7a62852644 Backport fix for Sun bug 6822370. 2010-03-10 Andrew John Hughes * Makefile.am: Add new patch. * patches/openjdk/6822370-reentrantreadwritelock.patch: Backported patch from HotSpot 16 to fix bug S6822370; threads blocked when the ReentrantReadWriteLock is not held. diff -r 29c75d7fc03a -r 373dcdea5871 ChangeLog --- a/ChangeLog Wed Jan 27 15:56:02 2010 +0000 +++ b/ChangeLog Thu Mar 11 01:51:53 2010 +0000 @@ -1,3 +1,12 @@ +2010-03-10 Andrew John Hughes + + * Makefile.am: + Add new patch. + * patches/openjdk/6822370-reentrantreadwritelock.patch: + Backported patch from HotSpot 16 to fix bug S6822370; + threads blocked when the ReentrantReadWriteLock is + not held. + 2010-01-27 Andrew John Hughes * NEWS: diff -r 29c75d7fc03a -r 373dcdea5871 Makefile.am --- a/Makefile.am Wed Jan 27 15:56:02 2010 +0000 +++ b/Makefile.am Thu Mar 11 01:51:53 2010 +0000 @@ -644,7 +644,8 @@ patches/security/icedtea-6872358.patch \ patches/icedtea-jar-misc.patch \ patches/icedtea-6897844-xshm.patch \ - patches/icedtea-linux-separate-debuginfo.patch + patches/icedtea-linux-separate-debuginfo.patch \ + patches/openjdk/6822370-reentrantreadwritelock.patch if WITH_ALT_HSBUILD ICEDTEA_PATCHES += \ diff -r 29c75d7fc03a -r 373dcdea5871 patches/openjdk/6822370-reentrantreadwritelock.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6822370-reentrantreadwritelock.patch Thu Mar 11 01:51:53 2010 +0000 @@ -0,0 +1,65 @@ +# HG changeset patch +# User dholmes +# Date 1259712624 18000 +# Node ID 49bd3de668dc35ba7cff876422d114a91f35bbd2 +# Parent b6e6e189e1db90e044c24be709bc581e2356a910 +6822370: ReentrantReadWriteLock: threads hung when there are no threads holding onto the lock (Netra x4450) +Summary: This day one bug is caused by missing memory barriers in various Parker::park() paths that can result in lost wakeups and hangs. +Reviewed-by: dice, acorn + +diff -r b6e6e189e1db -r 49bd3de668dc src/os/linux/vm/os_linux.cpp +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp Wed Nov 25 19:15:17 2009 -0800 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp Tue Dec 01 19:10:24 2009 -0500 +@@ -4656,6 +4656,7 @@ + // Return immediately if a permit is available. + if (_counter > 0) { + _counter = 0 ; ++ OrderAccess::fence(); + return ; + } + +@@ -4698,6 +4699,7 @@ + _counter = 0; + status = pthread_mutex_unlock(_mutex); + assert (status == 0, "invariant") ; ++ OrderAccess::fence(); + return; + } + +@@ -4737,7 +4739,7 @@ + if (jt->handle_special_suspend_equivalent_condition()) { + jt->java_suspend_self(); + } +- ++ OrderAccess::fence(); + } + + void Parker::unpark() { +diff -r b6e6e189e1db -r 49bd3de668dc src/os/solaris/vm/os_solaris.cpp +--- openjdk.orig/hotspot/src/os/solaris/vm/os_solaris.cpp Wed Nov 25 19:15:17 2009 -0800 ++++ openjdk/hotspot/src/os/solaris/vm/os_solaris.cpp Tue Dec 01 19:10:24 2009 -0500 +@@ -5803,6 +5803,7 @@ + // Return immediately if a permit is available. + if (_counter > 0) { + _counter = 0 ; ++ OrderAccess::fence(); + return ; + } + +@@ -5846,6 +5847,7 @@ + _counter = 0; + status = os::Solaris::mutex_unlock(_mutex); + assert (status == 0, "invariant") ; ++ OrderAccess::fence(); + return; + } + +@@ -5891,7 +5893,7 @@ + if (jt->handle_special_suspend_equivalent_condition()) { + jt->java_suspend_self(); + } +- ++ OrderAccess::fence(); + } + + void Parker::unpark() {