comparison src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @ 1833:8b10f48633dc

6984287: Regularize how GC parallel workers are specified. Summary: Associate number of GC workers with the workgang as opposed to the task. Reviewed-by: johnc, ysr
author jmasa
date Mon, 20 Sep 2010 14:38:38 -0700
parents 179464550c7d
children 899bbbdcb6ea
comparison
equal deleted inserted replaced
1781:97fbf5beff7b 1833:8b10f48633dc
122 _fitStrategy = FreeBlockStrategyNone; 122 _fitStrategy = FreeBlockStrategyNone;
123 } 123 }
124 checkFreeListConsistency(); 124 checkFreeListConsistency();
125 125
126 // Initialize locks for parallel case. 126 // Initialize locks for parallel case.
127 if (ParallelGCThreads > 0) { 127
128 if (CollectedHeap::use_parallel_gc_threads()) {
128 for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { 129 for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) {
129 _indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1 130 _indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1
130 "a freelist par lock", 131 "a freelist par lock",
131 true); 132 true);
132 if (_indexedFreeListParLocks[i] == NULL) 133 if (_indexedFreeListParLocks[i] == NULL)
1069 // Comment out this assertion until that problem can be solved 1070 // Comment out this assertion until that problem can be solved
1070 // (i.e., that the block start calculation may look at objects 1071 // (i.e., that the block start calculation may look at objects
1071 // at address below "p" in finding the object that contains "p" 1072 // at address below "p" in finding the object that contains "p"
1072 // and those objects (if garbage) may have been modified to hold 1073 // and those objects (if garbage) may have been modified to hold
1073 // live range information. 1074 // live range information.
1074 // assert(ParallelGCThreads > 0 || _bt.block_start(p) == p, "Should be a block boundary"); 1075 // assert(CollectedHeap::use_parallel_gc_threads() || _bt.block_start(p) == p,
1076 // "Should be a block boundary");
1075 if (FreeChunk::indicatesFreeChunk(p)) return false; 1077 if (FreeChunk::indicatesFreeChunk(p)) return false;
1076 klassOop k = oop(p)->klass_or_null(); 1078 klassOop k = oop(p)->klass_or_null();
1077 if (k != NULL) { 1079 if (k != NULL) {
1078 // Ignore mark word because it may have been used to 1080 // Ignore mark word because it may have been used to
1079 // chain together promoted objects (the last one 1081 // chain together promoted objects (the last one
2930 ((used_region().start() + (n_tasks - 1)*task_size < used_region().end()) && 2932 ((used_region().start() + (n_tasks - 1)*task_size < used_region().end()) &&
2931 (used_region().start() + n_tasks*task_size >= used_region().end())), 2933 (used_region().start() + n_tasks*task_size >= used_region().end())),
2932 "n_tasks calculation incorrect"); 2934 "n_tasks calculation incorrect");
2933 SequentialSubTasksDone* pst = conc_par_seq_tasks(); 2935 SequentialSubTasksDone* pst = conc_par_seq_tasks();
2934 assert(!pst->valid(), "Clobbering existing data?"); 2936 assert(!pst->valid(), "Clobbering existing data?");
2935 pst->set_par_threads(n_threads); 2937 // Sets the condition for completion of the subtask (how many threads
2938 // need to finish in order to be done).
2939 pst->set_n_threads(n_threads);
2936 pst->set_n_tasks((int)n_tasks); 2940 pst->set_n_tasks((int)n_tasks);
2937 } 2941 }
2938 2942
2939 // Set up the space's par_seq_tasks structure for work claiming 2943 // Set up the space's par_seq_tasks structure for work claiming
2940 // for parallel concurrent marking. See CMSConcMarkTask where this is currently used. 2944 // for parallel concurrent marking. See CMSConcMarkTask where this is currently used.
2970 ((span.start() + (n_tasks - 1)*task_size < span.end()) && 2974 ((span.start() + (n_tasks - 1)*task_size < span.end()) &&
2971 (span.start() + n_tasks*task_size >= span.end())), 2975 (span.start() + n_tasks*task_size >= span.end())),
2972 "n_tasks calculation incorrect"); 2976 "n_tasks calculation incorrect");
2973 SequentialSubTasksDone* pst = conc_par_seq_tasks(); 2977 SequentialSubTasksDone* pst = conc_par_seq_tasks();
2974 assert(!pst->valid(), "Clobbering existing data?"); 2978 assert(!pst->valid(), "Clobbering existing data?");
2975 pst->set_par_threads(n_threads); 2979 // Sets the condition for completion of the subtask (how many threads
2980 // need to finish in order to be done).
2981 pst->set_n_threads(n_threads);
2976 pst->set_n_tasks((int)n_tasks); 2982 pst->set_n_tasks((int)n_tasks);
2977 } 2983 }