Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5014723

implement "strip mining" loop optimization

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      These JSR-166 tests (part of the J2SE workspace)

      test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java
      test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java

      are known to fail on machines with multiple CPUs, both
      solaris-sparc and linux-amd64. It has never been seen to fail on
      uniprocessor machines (tested on linux-i586, windows-i586).
       
      The failures are seen on Tiger b43.

      The failures are not easy to reproduce. I see a failure about 1% of the
      time for both tests on both solaris-sparc and linux-amd64.

      My recipe for reproducing it is to run an infinite loop till a failure
      occurs, eg. for linux-amd64 I did:

      (martin@quoddy) java/util/concurrent/locks/ReentrantLock $ perl -e 'for ($i = 0;; $i++) { print "$i\n"; system("/u/martin/jct-tools/2.1.6/solaris/bin/jtreg -jdk:/u/martin/ws/tiger/build/linux-amd64/j2sdk-image -automatic TimeoutLockLoops.java"); exit 1 if $? != 0; }'

      which failed after 98 iterations.

      Here is an extract from a failing TimeoutLockLoops.jtr file:

      ----------System.out:(6/185)----------
      Threads: 1 0.038286s run time
      Threads: 2 0.039877s run time
      Threads: 3 0.0399s run time
      Threads: 5 0.039472s run time
      Threads: 8 0.059474s run time
      Threads: 12 0.079438s run time
      ----------System.err:(0/0)----------
      result: Failed. Execution failed: Program `/u/martin/ws/tiger/build/linux-amd64/j2sdk-image/bin/java' interrupted! (timed out?)


      test result: Failed. Execution failed: Program `/u/martin/ws/tiger/build/linux-amd64/j2sdk-image/bin/java' interrupted! (timed out?)

      Here is an extract from a failing CancelledProducerConsumerLoops.jtr file:

      ----------System.out:(14/490)----------
      Pairs:1
      ArrayBlockingQueue 3.0553042s run time
      LinkedBlockingQueue 2.2291932s run time
      SynchronousQueue 2.485516s run time
      Pairs:2
      ArrayBlockingQueue 4.0495974s run time
      LinkedBlockingQueue 3.4787056s run time
      SynchronousQueue 3.558907s run time
      Pairs:3
      ArrayBlockingQueue 4.8086858s run time
      LinkedBlockingQueue 3.1188338s run time
      SynchronousQueue 3.3789728s run time
      Pairs:5
      ArrayBlockingQueue 3.3516484s run time
      ----------System.err:(0/0)----------
      result: Failed. Execution failed: Program `/u/martin/ws/tiger/build/solaris-sparc/j2sdk-image/bin/java' interrupted! (timed out?)


      test result: Failed. Execution failed: Program `/u/martin/ws/tiger/build/solaris-sparc/j2sdk-image/bin/java' interrupted! (timed out?)

      I notice there are lingering processes after the test has stopped
      running, which must be killed manually.

      martin 15329 0.0 2.1 1344824 21604 pts/2 S 15:17 0:00 /u/martin/ws/tiger/build/linux-amd64/j2sdk-image/bin/java -Dtest.src=/export/martin/ws/canWrite/test/java/util/concurrent/BlockingQueue -Dtest.classes=/export/martin/ws/canWrite/test/java/util/concurrent/BlockingQueue/JTwork/classes/java/util/concurrent/BlockingQueue com.sun.javatest.regtest.MainWrapper /export/martin/ws/canWrite/test/java/util/concurrent/BlockingQueue/JTwork/classes/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.jta


      ###@###.### 2004-03-16

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kvn Vladimir Kozlov
                Reporter:
                martin Martin Buchholz
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: