src/share/vm/gc_implementation/g1/concurrentMark.hpp

Print this page
rev 4184 : 8004816: G1: Kitchensink failures after marking stack changes
Summary: Reset the marking state, including the mark stack overflow flag, in the event of a marking stack overflow during serial reference processing.
Reviewed-by: jmasa
   1 /*
   2  * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 444   NumberSeq   _remark_mark_times;
 445   NumberSeq   _remark_weak_ref_times;
 446   NumberSeq _cleanup_times;
 447   double    _total_counting_time;
 448   double    _total_rs_scrub_time;
 449 
 450   double*   _accum_task_vtime;   // accumulated task vtime
 451 
 452   FlexibleWorkGang* _parallel_workers;
 453 
 454   ForceOverflowSettings _force_overflow_conc;
 455   ForceOverflowSettings _force_overflow_stw;
 456 
 457   void weakRefsWork(bool clear_all_soft_refs);
 458 
 459   void swapMarkBitMaps();
 460 
 461   // It resets the global marking data structures, as well as the
 462   // task local ones; should be called during initial mark.
 463   void reset();
 464   // It resets all the marking data structures.
 465   void clear_marking_state(bool clear_overflow = true);
 466 
 467   // It should be called to indicate which phase we're in (concurrent
 468   // mark or remark) and how many threads are currently active.
 469   void set_phase(uint active_tasks, bool concurrent);

 470   // We do this after we're done with marking so that the marking data
 471   // structures are initialised to a sensible and predictable state.
 472   void set_non_marking_state();
 473 




 474   // prints all gathered CM-related statistics
 475   void print_stats();
 476 
 477   bool cleanup_list_is_empty() {
 478     return _cleanup_list.is_empty();
 479   }
 480 
 481   // accessor methods
 482   uint parallel_marking_threads() { return _parallel_marking_threads; }
 483   uint max_parallel_marking_threads() { return _max_parallel_marking_threads;}
 484   double sleep_factor()             { return _sleep_factor; }
 485   double marking_task_overhead()    { return _marking_task_overhead;}
 486   double cleanup_sleep_factor()     { return _cleanup_sleep_factor; }
 487   double cleanup_task_overhead()    { return _cleanup_task_overhead;}
 488 
 489   HeapWord*               finger()        { return _finger;   }
 490   bool                    concurrent()    { return _concurrent; }
 491   uint                    active_tasks()  { return _active_tasks; }
 492   ParallelTaskTerminator* terminator()    { return &_terminator; }
 493 


   1 /*
   2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 444   NumberSeq   _remark_mark_times;
 445   NumberSeq   _remark_weak_ref_times;
 446   NumberSeq _cleanup_times;
 447   double    _total_counting_time;
 448   double    _total_rs_scrub_time;
 449 
 450   double*   _accum_task_vtime;   // accumulated task vtime
 451 
 452   FlexibleWorkGang* _parallel_workers;
 453 
 454   ForceOverflowSettings _force_overflow_conc;
 455   ForceOverflowSettings _force_overflow_stw;
 456 
 457   void weakRefsWork(bool clear_all_soft_refs);
 458 
 459   void swapMarkBitMaps();
 460 
 461   // It resets the global marking data structures, as well as the
 462   // task local ones; should be called during initial mark.
 463   void reset();


 464 
 465   // Resets all the marking data structures. Called when we have to restart
 466   // marking or when marking completes (via set_non_marking_state below).
 467   void reset_marking_state(bool clear_overflow = true);
 468 
 469   // We do this after we're done with marking so that the marking data
 470   // structures are initialised to a sensible and predictable state.
 471   void set_non_marking_state();
 472 
 473   // It should be called to indicate which phase we're in (concurrent
 474   // mark or remark) and how many threads are currently active.
 475   void set_phase(uint active_tasks, bool concurrent);
 476 
 477   // prints all gathered CM-related statistics
 478   void print_stats();
 479 
 480   bool cleanup_list_is_empty() {
 481     return _cleanup_list.is_empty();
 482   }
 483 
 484   // accessor methods
 485   uint parallel_marking_threads() { return _parallel_marking_threads; }
 486   uint max_parallel_marking_threads() { return _max_parallel_marking_threads;}
 487   double sleep_factor()             { return _sleep_factor; }
 488   double marking_task_overhead()    { return _marking_task_overhead;}
 489   double cleanup_sleep_factor()     { return _cleanup_sleep_factor; }
 490   double cleanup_task_overhead()    { return _cleanup_task_overhead;}
 491 
 492   HeapWord*               finger()        { return _finger;   }
 493   bool                    concurrent()    { return _concurrent; }
 494   uint                    active_tasks()  { return _active_tasks; }
 495   ParallelTaskTerminator* terminator()    { return &_terminator; }
 496