< prev index next >

src/share/vm/gc/parallel/gcTaskManager.cpp

Print this page

        

*** 25,34 **** --- 25,35 ---- #include "precompiled.hpp" #include "gc/parallel/gcTaskManager.hpp" #include "gc/parallel/gcTaskThread.hpp" #include "gc/shared/adaptiveSizePolicy.hpp" #include "gc/shared/gcId.hpp" + #include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" #include "runtime/mutex.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/orderAccess.inline.hpp"
*** 463,479 **** assert(!all_workers_active() || active_workers() == ParallelGCThreads, "all_workers_active() is incorrect: " "active %d ParallelGCThreads %u", active_workers(), ParallelGCThreads); ! if (TraceDynamicGCThreads) { ! gclog_or_tty->print_cr("GCTaskManager::set_active_gang(): " "all_workers_active() %d workers %d " "active %d ParallelGCThreads %u", all_workers_active(), workers(), active_workers(), ParallelGCThreads); - } } // Create IdleGCTasks for inactive workers. // Creates tasks in a ResourceArea and assumes // an appropriate ResourceMark. --- 464,478 ---- assert(!all_workers_active() || active_workers() == ParallelGCThreads, "all_workers_active() is incorrect: " "active %d ParallelGCThreads %u", active_workers(), ParallelGCThreads); ! log_trace(gc, task)("GCTaskManager::set_active_gang(): " "all_workers_active() %d workers %d " "active %d ParallelGCThreads %u", all_workers_active(), workers(), active_workers(), ParallelGCThreads); } // Create IdleGCTasks for inactive workers. // Creates tasks in a ResourceArea and assumes // an appropriate ResourceMark.
*** 500,519 **** if (more_inactive_workers < 0) { int reduced_active_workers = active_workers() + more_inactive_workers; set_active_workers(reduced_active_workers); more_inactive_workers = 0; } ! if (TraceDynamicGCThreads) { ! gclog_or_tty->print_cr("JT: %d workers %d active %d " ! "idle %d more %d", Threads::number_of_non_daemon_threads(), workers(), active_workers(), idle_workers(), more_inactive_workers); } - } GCTaskQueue* q = GCTaskQueue::create(); for(uint i = 0; i < (uint) more_inactive_workers; i++) { q->enqueue(IdleGCTask::create_on_c_heap()); increment_idle_workers(); } --- 499,515 ---- if (more_inactive_workers < 0) { int reduced_active_workers = active_workers() + more_inactive_workers; set_active_workers(reduced_active_workers); more_inactive_workers = 0; } ! log_trace(gc, task)("JT: %d workers %d active %d idle %d more %d", Threads::number_of_non_daemon_threads(), workers(), active_workers(), idle_workers(), more_inactive_workers); } GCTaskQueue* q = GCTaskQueue::create(); for(uint i = 0; i < (uint) more_inactive_workers; i++) { q->enqueue(IdleGCTask::create_on_c_heap()); increment_idle_workers(); }
*** 534,543 **** --- 530,542 ---- // Release monitor } } void GCTaskManager::print_task_time_stamps() { + if (!Log<LOG_TAGS(gc, task, time)>::is_debug()) { + return; + } for(uint i=0; i<ParallelGCThreads; i++) { GCTaskThread* t = thread(i); t->print_task_time_stamps(); } }
*** 826,867 **** return result; } void IdleGCTask::do_it(GCTaskManager* manager, uint which) { WaitHelper* wait_helper = manager->wait_helper(); ! if (TraceGCTaskManager) { ! tty->print_cr("[" INTPTR_FORMAT "]" ! " IdleGCTask:::do_it()" ! " should_wait: %s", p2i(this), wait_helper->should_wait() ? "true" : "false"); ! } MutexLockerEx ml(manager->monitor(), Mutex::_no_safepoint_check_flag); ! if (TraceDynamicGCThreads) { ! gclog_or_tty->print_cr("--- idle %d", which); ! } // Increment has to be done when the idle tasks are created. // manager->increment_idle_workers(); manager->monitor()->notify_all(); while (wait_helper->should_wait()) { ! if (TraceGCTaskManager) { ! tty->print_cr("[" INTPTR_FORMAT "]" ! " IdleGCTask::do_it()" ! " [" INTPTR_FORMAT "] (%s)->wait()", p2i(this), p2i(manager->monitor()), manager->monitor()->name()); - } manager->monitor()->wait(Mutex::_no_safepoint_check_flag, 0); } manager->decrement_idle_workers(); ! if (TraceDynamicGCThreads) { ! gclog_or_tty->print_cr("--- release %d", which); ! } ! if (TraceGCTaskManager) { ! tty->print_cr("[" INTPTR_FORMAT "]" ! " IdleGCTask::do_it() returns" ! " should_wait: %s", p2i(this), wait_helper->should_wait() ? "true" : "false"); - } // Release monitor(). } void IdleGCTask::destroy(IdleGCTask* that) { if (that != NULL) { --- 825,852 ---- return result; } void IdleGCTask::do_it(GCTaskManager* manager, uint which) { WaitHelper* wait_helper = manager->wait_helper(); ! log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask:::do_it() should_wait: %s", p2i(this), wait_helper->should_wait() ? "true" : "false"); ! MutexLockerEx ml(manager->monitor(), Mutex::_no_safepoint_check_flag); ! log_trace(gc, task)("--- idle %d", which); // Increment has to be done when the idle tasks are created. // manager->increment_idle_workers(); manager->monitor()->notify_all(); while (wait_helper->should_wait()) { ! log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask::do_it() [" INTPTR_FORMAT "] (%s)->wait()", p2i(this), p2i(manager->monitor()), manager->monitor()->name()); manager->monitor()->wait(Mutex::_no_safepoint_check_flag, 0); } manager->decrement_idle_workers(); ! ! log_trace(gc, task)("--- release %d", which); ! log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask::do_it() returns should_wait: %s", p2i(this), wait_helper->should_wait() ? "true" : "false"); // Release monitor(). } void IdleGCTask::destroy(IdleGCTask* that) { if (that != NULL) {
< prev index next >