1 /*
2 * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
97 const uint max_index = MIN2(_time_stamp_index, GCTaskTimeStampEntries);
98 for (uint i = 0; i < max_index; i++) {
99 GCTaskTimeStamp* time_stamp = time_stamp_at(i);
100 log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]",
101 time_stamp->name(),
102 time_stamp->entry_time(),
103 time_stamp->exit_time());
104 }
105
106 // Reset after dumping the data
107 _time_stamp_index = 0;
108 }
109 }
110
111 // GC workers get tasks from the GCTaskManager and execute
112 // them in this method. If there are no tasks to execute,
113 // the GC workers wait in the GCTaskManager's get_task()
114 // for tasks to be enqueued for execution.
115
116 void GCTaskThread::run() {
117 this->initialize_named_thread();
118 // Bind yourself to your processor.
119 if (processor_id() != GCTaskManager::sentinel_worker()) {
120 log_trace(gc, task, thread)("GCTaskThread::run: binding to processor %u", processor_id());
121 if (!os::bind_to_processor(processor_id())) {
122 DEBUG_ONLY(
123 log_warning(gc)("Couldn't bind GCTaskThread %u to processor %u",
124 which(), processor_id());
125 )
126 }
127 }
128 // Part of thread setup.
129 // ??? Are these set up once here to make subsequent ones fast?
130 HandleMark hm_outer;
131 ResourceMark rm_outer;
132
133 TimeStamp timer;
134
135 for (;/* ever */;) {
136 // These are so we can flush the resources allocated in the inner loop.
137 HandleMark hm_inner;
|
1 /*
2 * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
97 const uint max_index = MIN2(_time_stamp_index, GCTaskTimeStampEntries);
98 for (uint i = 0; i < max_index; i++) {
99 GCTaskTimeStamp* time_stamp = time_stamp_at(i);
100 log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]",
101 time_stamp->name(),
102 time_stamp->entry_time(),
103 time_stamp->exit_time());
104 }
105
106 // Reset after dumping the data
107 _time_stamp_index = 0;
108 }
109 }
110
111 // GC workers get tasks from the GCTaskManager and execute
112 // them in this method. If there are no tasks to execute,
113 // the GC workers wait in the GCTaskManager's get_task()
114 // for tasks to be enqueued for execution.
115
116 void GCTaskThread::run() {
117 // Bind yourself to your processor.
118 if (processor_id() != GCTaskManager::sentinel_worker()) {
119 log_trace(gc, task, thread)("GCTaskThread::run: binding to processor %u", processor_id());
120 if (!os::bind_to_processor(processor_id())) {
121 DEBUG_ONLY(
122 log_warning(gc)("Couldn't bind GCTaskThread %u to processor %u",
123 which(), processor_id());
124 )
125 }
126 }
127 // Part of thread setup.
128 // ??? Are these set up once here to make subsequent ones fast?
129 HandleMark hm_outer;
130 ResourceMark rm_outer;
131
132 TimeStamp timer;
133
134 for (;/* ever */;) {
135 // These are so we can flush the resources allocated in the inner loop.
136 HandleMark hm_inner;
|