Mercurial > hg > graal-jvmci-8
diff src/share/vm/gc_implementation/g1/satbQueue.hpp @ 1317:d4197f8d516a
6935821: G1: threads created during marking do not active their SATB queues
Summary: Newly-created threads always had the active field of their SATB queue initialized to false, even if they were created during marking. As a result, updates from threads created during a marking cycle were never enqueued and never processed. The fix includes remaining a method from active() to is_active() for readability and naming consistency.
Reviewed-by: ysr, johnc
author | tonyp |
---|---|
date | Thu, 18 Mar 2010 12:14:59 -0400 |
parents | 44f61c24ddab |
children | c18cbe5936b8 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/satbQueue.hpp Mon Mar 22 02:40:53 2010 -0700 +++ b/src/share/vm/gc_implementation/g1/satbQueue.hpp Thu Mar 18 12:14:59 2010 -0400 @@ -29,8 +29,7 @@ class ObjPtrQueue: public PtrQueue { public: ObjPtrQueue(PtrQueueSet* qset_, bool perm = false) : - PtrQueue(qset_, perm) - {} + PtrQueue(qset_, perm, qset_->is_active()) { } // Apply the closure to all elements, and reset the index to make the // buffer empty. void apply_closure(ObjectClosure* cl); @@ -55,6 +54,9 @@ // is ignored. bool apply_closure_to_completed_buffer_work(bool par, int worker); +#ifdef ASSERT + void dump_active_values(JavaThread* first, bool expected_active); +#endif // ASSERT public: SATBMarkQueueSet(); @@ -65,9 +67,11 @@ static void handle_zero_index_for_thread(JavaThread* t); - // Apply "set_active(b)" to all thread tloq's. Should be called only - // with the world stopped. - void set_active_all_threads(bool b); + // Apply "set_active(b)" to all Java threads' SATB queues. It should be + // called only with the world stopped. The method will assert that the + // SATB queues of all threads it visits, as well as the SATB queue + // set itself, has an active value same as expected_active. + void set_active_all_threads(bool b, bool expected_active); // Register "blk" as "the closure" for all queues. Only one such closure // is allowed. The "apply_closure_to_completed_buffer" method will apply