Merge
authortschatzl
Wed, 22 Jun 2016 10:49:23 +0200
changeset 39408 598092582b4e
parent 39406 e0a7495281a7 (current diff)
parent 39407 2e75eb109278 (diff)
child 39409 40460a932140
Merge
--- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Tue Jun 21 15:02:45 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Wed Jun 22 10:49:23 2016 +0200
@@ -137,7 +137,9 @@
   do {
     // Drain the overflow stack first, so other threads can steal.
     while (_refs->pop_overflow(ref)) {
-      dispatch_reference(ref);
+      if (!_refs->try_push_to_taskqueue(ref)) {
+        dispatch_reference(ref);
+      }
     }
 
     while (_refs->pop_local(ref)) {
--- a/hotspot/src/share/vm/gc/shared/taskqueue.hpp	Tue Jun 21 15:02:45 2016 +0200
+++ b/hotspot/src/share/vm/gc/shared/taskqueue.hpp	Wed Jun 22 10:49:23 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -330,6 +330,8 @@
 
   // Push task t onto the queue or onto the overflow stack.  Return true.
   inline bool push(E t);
+  // Try to push task t onto the queue only. Returns true if successful, false otherwise.
+  inline bool try_push_to_taskqueue(E t);
 
   // Attempt to pop from the overflow stack; return true if anything was popped.
   inline bool pop_overflow(E& t);
--- a/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp	Tue Jun 21 15:02:45 2016 +0200
+++ b/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp	Wed Jun 22 10:49:23 2016 +0200
@@ -103,6 +103,11 @@
   return true;
 }
 
+template <class E, MEMFLAGS F, unsigned int N>
+inline bool OverflowTaskQueue<E, F, N>::try_push_to_taskqueue(E t) {
+  return taskqueue_t::push(t);
+}
+
 // pop_local_slow() is done by the owning thread and is trying to
 // get the last task in the queue.  It will compete with pop_global()
 // that will be used by other threads.  The tag age is incremented