3754
3755 statsOnly( int tmp_size = _task_queue->size();
3756 if (tmp_size > _local_max_size) {
3757 _local_max_size = tmp_size;
3758 }
3759 _local_pushes += n );
3760 }
3761
3762 // this operation was quite expensive, so decrease the limits
3763 decrease_limits();
3764 }
3765
3766 void CMTask::drain_local_queue(bool partially) {
3767 if (has_aborted()) return;
3768
3769 // Decide what the target size is, depending whether we're going to
3770 // drain it partially (so that other tasks can steal if they run out
3771 // of things to do) or totally (at the very end).
3772 size_t target_size;
3773 if (partially) {
3774 target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
3775 } else {
3776 target_size = 0;
3777 }
3778
3779 if (_task_queue->size() > target_size) {
3780 if (_cm->verbose_high()) {
3781 gclog_or_tty->print_cr("[%u] draining local queue, target size = " SIZE_FORMAT,
3782 _worker_id, target_size);
3783 }
3784
3785 oop obj;
3786 bool ret = _task_queue->pop_local(obj);
3787 while (ret) {
3788 statsOnly( ++_local_pops );
3789
3790 if (_cm->verbose_high()) {
3791 gclog_or_tty->print_cr("[%u] popped "PTR_FORMAT, _worker_id,
3792 p2i((void*) obj));
3793 }
3794
|
3754
3755 statsOnly( int tmp_size = _task_queue->size();
3756 if (tmp_size > _local_max_size) {
3757 _local_max_size = tmp_size;
3758 }
3759 _local_pushes += n );
3760 }
3761
3762 // this operation was quite expensive, so decrease the limits
3763 decrease_limits();
3764 }
3765
3766 void CMTask::drain_local_queue(bool partially) {
3767 if (has_aborted()) return;
3768
3769 // Decide what the target size is, depending whether we're going to
3770 // drain it partially (so that other tasks can steal if they run out
3771 // of things to do) or totally (at the very end).
3772 size_t target_size;
3773 if (partially) {
3774 target_size = MIN2((_task_queue->max_elems()/3), GCDrainStackTargetSize);
3775 } else {
3776 target_size = 0;
3777 }
3778
3779 if (_task_queue->size() > target_size) {
3780 if (_cm->verbose_high()) {
3781 gclog_or_tty->print_cr("[%u] draining local queue, target size = " SIZE_FORMAT,
3782 _worker_id, target_size);
3783 }
3784
3785 oop obj;
3786 bool ret = _task_queue->pop_local(obj);
3787 while (ret) {
3788 statsOnly( ++_local_pops );
3789
3790 if (_cm->verbose_high()) {
3791 gclog_or_tty->print_cr("[%u] popped "PTR_FORMAT, _worker_id,
3792 p2i((void*) obj));
3793 }
3794
|