7114303: G1: assert(_g1->mark_in_progress()) failed: shouldn't be here otherwise

Mon, 28 Nov 2011 09:49:05 -0800

author
johnc
date
Mon, 28 Nov 2011 09:49:05 -0800
changeset 3295
00dd86e542eb
parent 3294
bca17e38de00
child 3296
dc467e8b2c5e

7114303: G1: assert(_g1->mark_in_progress()) failed: shouldn't be here otherwise
Summary: Race between the VM thread reading G1CollectedHeap::_mark_in_progress and it being set by the concurrent mark thread when concurrent marking is aborted by a full GC. Have the concurrent mark thread join the SuspendibleThreadSet before changing the marking state.
Reviewed-by: tonyp, brutisso

src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp file | annotate | diff | comparison | revisions
src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp file | annotate | diff | comparison | revisions
src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Tue Aug 09 10:16:01 2011 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Mon Nov 28 09:49:05 2011 -0800
     1.3 @@ -191,7 +191,11 @@
     1.4          VM_CGC_Operation op(&cl_cl, verbose_str);
     1.5          VMThread::execute(&op);
     1.6        } else {
     1.7 +        // We don't want to update the marking status if a GC pause
     1.8 +        // is already underway.
     1.9 +        _sts.join();
    1.10          g1h->set_marking_complete();
    1.11 +        _sts.leave();
    1.12        }
    1.13  
    1.14        // Check if cleanup set the free_regions_coming flag. If it
     2.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Tue Aug 09 10:16:01 2011 -0700
     2.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Mon Nov 28 09:49:05 2011 -0800
     2.3 @@ -946,10 +946,9 @@
     2.4      _cur_aux_times_set[i] = false;
     2.5    }
     2.6  
     2.7 -  // These are initialized to zero here and they are set during
     2.8 +  // This is initialized to zero here and is set during
     2.9    // the evacuation pause if marking is in progress.
    2.10    _cur_satb_drain_time_ms = 0.0;
    2.11 -  _last_satb_drain_processed_buffers = 0;
    2.12  
    2.13    _last_young_gc_full = false;
    2.14  
    2.15 @@ -1367,7 +1366,6 @@
    2.16  
    2.17      if (print_marking_info) {
    2.18        print_stats(1, "SATB Drain Time", _cur_satb_drain_time_ms);
    2.19 -      print_stats(2, "Processed Buffers", _last_satb_drain_processed_buffers);
    2.20      }
    2.21  
    2.22      if (parallel) {
     3.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Tue Aug 09 10:16:01 2011 -0700
     3.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Mon Nov 28 09:49:05 2011 -0800
     3.3 @@ -534,7 +534,6 @@
     3.4    double sum_of_values (double* data);
     3.5    double max_sum (double* data1, double* data2);
     3.6  
     3.7 -  int _last_satb_drain_processed_buffers;
     3.8    double _last_pause_time_ms;
     3.9  
    3.10    size_t _bytes_in_collection_set_before_gc;
    3.11 @@ -774,11 +773,6 @@
    3.12      _cur_satb_drain_time_ms = ms;
    3.13    }
    3.14  
    3.15 -  void record_satb_drain_processed_buffers(int processed_buffers) {
    3.16 -    assert(_g1->mark_in_progress(), "shouldn't be here otherwise");
    3.17 -    _last_satb_drain_processed_buffers = processed_buffers;
    3.18 -  }
    3.19 -
    3.20    void record_update_rs_time(int thread, double ms) {
    3.21      _par_last_update_rs_times_ms[thread] = ms;
    3.22    }

mercurial