< prev index next >
src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp
Print this page
*** 2643,2653 ****
CMSSynchronousYieldRequest yr;
assert(!tlab, "Can't deal with TLAB allocation");
MutexLocker x(freelistLock(), Mutex::_no_safepoint_check_flag);
expand_for_gc_cause(word_size*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_allocation);
if (GCExpandToAllocateDelayMillis > 0) {
! os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
}
return have_lock_and_allocate(word_size, tlab);
}
void ConcurrentMarkSweepGeneration::expand_for_gc_cause(
--- 2643,2653 ----
CMSSynchronousYieldRequest yr;
assert(!tlab, "Can't deal with TLAB allocation");
MutexLocker x(freelistLock(), Mutex::_no_safepoint_check_flag);
expand_for_gc_cause(word_size*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_allocation);
if (GCExpandToAllocateDelayMillis > 0) {
! os::naked_sleep(GCExpandToAllocateDelayMillis);
}
return have_lock_and_allocate(word_size, tlab);
}
void ConcurrentMarkSweepGeneration::expand_for_gc_cause(
*** 2682,2692 ****
expand_for_gc_cause(word_sz*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_allocate_par_lab);
// Now go around the loop and try alloc again;
// A competing par_promote might beat us to the expansion space,
// so we may go around the loop again if promotion fails again.
if (GCExpandToAllocateDelayMillis > 0) {
! os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
}
}
}
--- 2682,2692 ----
expand_for_gc_cause(word_sz*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_allocate_par_lab);
// Now go around the loop and try alloc again;
// A competing par_promote might beat us to the expansion space,
// so we may go around the loop again if promotion fails again.
if (GCExpandToAllocateDelayMillis > 0) {
! os::naked_sleep(GCExpandToAllocateDelayMillis);
}
}
}
*** 2709,2719 ****
expand_for_gc_cause(refill_size_bytes, MinHeapDeltaBytes, CMSExpansionCause::_allocate_par_spooling_space);
// Now go around the loop and try alloc again;
// A competing allocation might beat us to the expansion space,
// so we may go around the loop again if allocation fails again.
if (GCExpandToAllocateDelayMillis > 0) {
! os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
}
}
}
void ConcurrentMarkSweepGeneration::shrink(size_t bytes) {
--- 2709,2719 ----
expand_for_gc_cause(refill_size_bytes, MinHeapDeltaBytes, CMSExpansionCause::_allocate_par_spooling_space);
// Now go around the loop and try alloc again;
// A competing allocation might beat us to the expansion space,
// so we may go around the loop again if allocation fails again.
if (GCExpandToAllocateDelayMillis > 0) {
! os::naked_sleep(GCExpandToAllocateDelayMillis);
}
}
}
void ConcurrentMarkSweepGeneration::shrink(size_t bytes) {
*** 3542,3552 ****
//
// Tony 2006.06.29
for (unsigned i = 0; i < CMSCoordinatorYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::sleep(Thread::current(), 1, false);
}
ConcurrentMarkSweepThread::synchronize(true);
_bit_map_lock->lock_without_safepoint_check();
_collector->startTimer();
--- 3542,3552 ----
//
// Tony 2006.06.29
for (unsigned i = 0; i < CMSCoordinatorYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_bit_map_lock->lock_without_safepoint_check();
_collector->startTimer();
*** 5539,5549 ****
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::sleep(Thread::current(), 1, false);
}
ConcurrentMarkSweepThread::synchronize(true);
bitMapLock()->lock_without_safepoint_check();
startTimer();
--- 5539,5549 ----
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
bitMapLock()->lock_without_safepoint_check();
startTimer();
*** 5993,6003 ****
for (unsigned i = 0;
i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive();
++i) {
! os::sleep(Thread::current(), 1, false);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bit_map->lock()->lock_without_safepoint_check();
--- 5993,6003 ----
for (unsigned i = 0;
i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive();
++i) {
! os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bit_map->lock()->lock_without_safepoint_check();
*** 6148,6158 ****
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::sleep(Thread::current(), 1, false);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bitMap->lock()->lock_without_safepoint_check();
--- 6148,6158 ----
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bitMap->lock()->lock_without_safepoint_check();
*** 6215,6225 ****
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::sleep(Thread::current(), 1, false);
}
ConcurrentMarkSweepThread::synchronize(true);
_bit_map->lock()->lock_without_safepoint_check();
_collector->startTimer();
--- 6215,6225 ----
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_bit_map->lock()->lock_without_safepoint_check();
_collector->startTimer();
*** 6366,6376 ****
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::sleep(Thread::current(), 1, false);
}
ConcurrentMarkSweepThread::synchronize(true);
_bitMap->lock()->lock_without_safepoint_check();
_collector->startTimer();
--- 6366,6376 ----
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_bitMap->lock()->lock_without_safepoint_check();
_collector->startTimer();
*** 6980,6990 ****
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::sleep(Thread::current(), 1, false);
}
ConcurrentMarkSweepThread::synchronize(true);
bml->lock_without_safepoint_check();
--- 6980,6990 ----
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
bml->lock_without_safepoint_check();
*** 7545,7555 ****
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::sleep(Thread::current(), 1, false);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bitMap->lock()->lock_without_safepoint_check();
--- 7545,7555 ----
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
! os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bitMap->lock()->lock_without_safepoint_check();
*** 7843,7861 ****
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);
// If the list is busy, we spin for a short while,
// sleeping between attempts to get the list.
for (size_t spin = 0; prefix == BUSY && spin < CMSOverflowSpinCount; spin++) {
! os::sleep(tid, sleep_time_millis, false);
if (_overflow_list == NULL) {
// Nothing left to take
return false;
} else if (_overflow_list != BUSY) {
// Try and grab the prefix
--- 7843,7860 ----
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));
// 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);
// If the list is busy, we spin for a short while,
// sleeping between attempts to get the list.
for (size_t spin = 0; prefix == BUSY && spin < CMSOverflowSpinCount; spin++) {
! os::naked_sleep(sleep_time_millis);
if (_overflow_list == NULL) {
// Nothing left to take
return false;
} else if (_overflow_list != BUSY) {
// Try and grab the prefix
< prev index next >