< prev index next >
src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp
Print this page
@@ -2643,11 +2643,11 @@
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);
+ os::naked_sleep(GCExpandToAllocateDelayMillis);
}
return have_lock_and_allocate(word_size, tlab);
}
void ConcurrentMarkSweepGeneration::expand_for_gc_cause(
@@ -2682,11 +2682,11 @@
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);
+ os::naked_sleep(GCExpandToAllocateDelayMillis);
}
}
}
@@ -2709,11 +2709,11 @@
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);
+ os::naked_sleep(GCExpandToAllocateDelayMillis);
}
}
}
void ConcurrentMarkSweepGeneration::shrink(size_t bytes) {
@@ -3542,11 +3542,11 @@
//
// Tony 2006.06.29
for (unsigned i = 0; i < CMSCoordinatorYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
- os::sleep(Thread::current(), 1, false);
+ os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_bit_map_lock->lock_without_safepoint_check();
_collector->startTimer();
@@ -5539,11 +5539,11 @@
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
- os::sleep(Thread::current(), 1, false);
+ os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
bitMapLock()->lock_without_safepoint_check();
startTimer();
@@ -5993,11 +5993,11 @@
for (unsigned i = 0;
i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive();
++i) {
- os::sleep(Thread::current(), 1, false);
+ os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bit_map->lock()->lock_without_safepoint_check();
@@ -6148,11 +6148,11 @@
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
- os::sleep(Thread::current(), 1, false);
+ os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bitMap->lock()->lock_without_safepoint_check();
@@ -6215,11 +6215,11 @@
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
- os::sleep(Thread::current(), 1, false);
+ os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_bit_map->lock()->lock_without_safepoint_check();
_collector->startTimer();
@@ -6366,11 +6366,11 @@
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
- os::sleep(Thread::current(), 1, false);
+ os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_bitMap->lock()->lock_without_safepoint_check();
_collector->startTimer();
@@ -6980,11 +6980,11 @@
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
- os::sleep(Thread::current(), 1, false);
+ os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
bml->lock_without_safepoint_check();
@@ -7545,11 +7545,11 @@
// See the comment in coordinator_yield()
for (unsigned i = 0; i < CMSYieldSleepCount &&
ConcurrentMarkSweepThread::should_yield() &&
!CMSCollector::foregroundGCIsActive(); ++i) {
- os::sleep(Thread::current(), 1, false);
+ os::naked_short_sleep(1);
}
ConcurrentMarkSweepThread::synchronize(true);
_freelistLock->lock_without_safepoint_check();
_bitMap->lock()->lock_without_safepoint_check();
@@ -7843,19 +7843,18 @@
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);
+ 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 >