< prev index next >

src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp

Print this page

        

*** 1074,1084 **** collector()->promoted(true, // parallel obj_ptr, old->is_objArray(), word_sz); NOT_PRODUCT( Atomic::inc(&_numObjectsPromoted); ! Atomic::add_ptr(alloc_sz, &_numWordsPromoted); ) return obj; } --- 1074,1084 ---- collector()->promoted(true, // parallel obj_ptr, old->is_objArray(), word_sz); NOT_PRODUCT( Atomic::inc(&_numObjectsPromoted); ! Atomic::add(alloc_sz, &_numWordsPromoted); ) return obj; }
*** 3177,3187 **** void CMSConcMarkingTask::bump_global_finger(HeapWord* f) { HeapWord* read = _global_finger; HeapWord* cur = read; while (f > read) { cur = read; ! read = (HeapWord*) Atomic::cmpxchg_ptr(f, &_global_finger, cur); if (cur == read) { // our cas succeeded assert(_global_finger >= f, "protocol consistency"); break; } --- 3177,3187 ---- void CMSConcMarkingTask::bump_global_finger(HeapWord* f) { HeapWord* read = _global_finger; HeapWord* cur = read; while (f > read) { cur = read; ! read = Atomic::cmpxchg(f, &_global_finger, cur); if (cur == read) { // our cas succeeded assert(_global_finger >= f, "protocol consistency"); break; }
*** 7850,7860 **** assert(num < work_q->max_elems(), "Can't bite more than we can chew"); if (_overflow_list == NULL) { return false; } // Grab the entire list; we'll put back a suffix ! oop prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list)); Thread* tid = Thread::current(); // Before "no_of_gc_threads" was introduced CMSOverflowSpinCount was // set to ParallelGCThreads. size_t CMSOverflowSpinCount = (size_t) no_of_gc_threads; // was ParallelGCThreads; size_t sleep_time_millis = MAX2((size_t)1, num/100); --- 7850,7860 ---- assert(num < work_q->max_elems(), "Can't bite more than we can chew"); if (_overflow_list == NULL) { return false; } // Grab the entire list; we'll put back a suffix ! oop prefix = cast_to_oop(Atomic::xchg((oopDesc*)BUSY, &_overflow_list)); Thread* tid = Thread::current(); // Before "no_of_gc_threads" was introduced CMSOverflowSpinCount was // set to ParallelGCThreads. size_t CMSOverflowSpinCount = (size_t) no_of_gc_threads; // was ParallelGCThreads; size_t sleep_time_millis = MAX2((size_t)1, num/100);
*** 7865,7875 **** if (_overflow_list == NULL) { // Nothing left to take return false; } else if (_overflow_list != BUSY) { // Try and grab the prefix ! prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list)); } } // If the list was found to be empty, or we spun long // enough, we give up and return empty-handed. If we leave // the list in the BUSY state below, it must be the case that --- 7865,7875 ---- if (_overflow_list == NULL) { // Nothing left to take return false; } else if (_overflow_list != BUSY) { // Try and grab the prefix ! prefix = cast_to_oop(Atomic::xchg((oopDesc*)BUSY, &_overflow_list)); } } // If the list was found to be empty, or we spun long // enough, we give up and return empty-handed. If we leave // the list in the BUSY state below, it must be the case that
*** 7878,7888 **** if (prefix == NULL || prefix == BUSY) { // Nothing to take or waited long enough if (prefix == NULL) { // Write back the NULL in case we overwrote it with BUSY above // and it is still the same value. ! (void) Atomic::cmpxchg_ptr(NULL, &_overflow_list, BUSY); } return false; } assert(prefix != NULL && prefix != BUSY, "Error"); size_t i = num; --- 7878,7888 ---- if (prefix == NULL || prefix == BUSY) { // Nothing to take or waited long enough if (prefix == NULL) { // Write back the NULL in case we overwrote it with BUSY above // and it is still the same value. ! Atomic::cmpxchg((oopDesc*)NULL, &_overflow_list, (oopDesc*)BUSY); } return false; } assert(prefix != NULL && prefix != BUSY, "Error"); size_t i = num;
*** 7893,7903 **** // We have "num" or fewer elements in the list, so there // is nothing to return to the global list. // Write back the NULL in lieu of the BUSY we wrote // above, if it is still the same value. if (_overflow_list == BUSY) { ! (void) Atomic::cmpxchg_ptr(NULL, &_overflow_list, BUSY); } } else { // Chop off the suffix and return it to the global list. assert(cur->mark() != BUSY, "Error"); oop suffix_head = cur->mark(); // suffix will be put back on global list --- 7893,7903 ---- // We have "num" or fewer elements in the list, so there // is nothing to return to the global list. // Write back the NULL in lieu of the BUSY we wrote // above, if it is still the same value. if (_overflow_list == BUSY) { ! Atomic::cmpxchg((oopDesc*)NULL, &_overflow_list, (oopDesc*)BUSY); } } else { // Chop off the suffix and return it to the global list. assert(cur->mark() != BUSY, "Error"); oop suffix_head = cur->mark(); // suffix will be put back on global list
*** 7909,7919 **** oop observed_overflow_list = _overflow_list; oop cur_overflow_list = observed_overflow_list; bool attached = false; while (observed_overflow_list == BUSY || observed_overflow_list == NULL) { observed_overflow_list = ! (oop) Atomic::cmpxchg_ptr(suffix_head, &_overflow_list, cur_overflow_list); if (cur_overflow_list == observed_overflow_list) { attached = true; break; } else cur_overflow_list = observed_overflow_list; } --- 7909,7919 ---- oop observed_overflow_list = _overflow_list; oop cur_overflow_list = observed_overflow_list; bool attached = false; while (observed_overflow_list == BUSY || observed_overflow_list == NULL) { observed_overflow_list = ! Atomic::cmpxchg((oopDesc*)suffix_head, &_overflow_list, (oopDesc*)cur_overflow_list); if (cur_overflow_list == observed_overflow_list) { attached = true; break; } else cur_overflow_list = observed_overflow_list; }
*** 7934,7944 **** } else { // cur_overflow_list == BUSY suffix_tail->set_mark(NULL); } // ... and try to place spliced list back on overflow_list ... observed_overflow_list = ! (oop) Atomic::cmpxchg_ptr(suffix_head, &_overflow_list, cur_overflow_list); } while (cur_overflow_list != observed_overflow_list); // ... until we have succeeded in doing so. } } --- 7934,7944 ---- } else { // cur_overflow_list == BUSY suffix_tail->set_mark(NULL); } // ... and try to place spliced list back on overflow_list ... observed_overflow_list = ! Atomic::cmpxchg((oopDesc*)suffix_head, &_overflow_list, (oopDesc*)cur_overflow_list); } while (cur_overflow_list != observed_overflow_list); // ... until we have succeeded in doing so. } }
*** 7955,7965 **** assert(res, "Bit off more than we can chew?"); NOT_PRODUCT(n++;) } #ifndef PRODUCT assert(_num_par_pushes >= n, "Too many pops?"); ! Atomic::add_ptr(-(intptr_t)n, &_num_par_pushes); #endif return true; } // Single-threaded --- 7955,7965 ---- assert(res, "Bit off more than we can chew?"); NOT_PRODUCT(n++;) } #ifndef PRODUCT assert(_num_par_pushes >= n, "Too many pops?"); ! Atomic::add(-n, &_num_par_pushes); #endif return true; } // Single-threaded
*** 7984,7994 **** p->set_mark(markOop(cur_overflow_list)); } else { p->set_mark(NULL); } observed_overflow_list = ! (oop) Atomic::cmpxchg_ptr(p, &_overflow_list, cur_overflow_list); } while (cur_overflow_list != observed_overflow_list); } #undef BUSY // Single threaded --- 7984,7994 ---- p->set_mark(markOop(cur_overflow_list)); } else { p->set_mark(NULL); } observed_overflow_list = ! Atomic::cmpxchg((oopDesc*)p, &_overflow_list, (oopDesc*)cur_overflow_list); } while (cur_overflow_list != observed_overflow_list); } #undef BUSY // Single threaded
< prev index next >