Skip to content

Commit fb15b05

Browse files
authored
Merge branch 'master' into goetz_backport_8308875
2 parents b8ac17e + 0990347 commit fb15b05

File tree

26 files changed

+442
-160
lines changed

26 files changed

+442
-160
lines changed

src/hotspot/os/linux/cgroupSubsystem_linux.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ template <typename T> int subsystem_file_line_contents(CgroupController* c,
147147
}
148148
PRAGMA_DIAG_POP
149149

150+
// log_fmt can be different than scan_fmt. For example
151+
// cpu_period() for cgv2 uses log_fmt='%d' and scan_fmt='%*s %d'
150152
#define GET_CONTAINER_INFO(return_type, subsystem, filename, \
151-
logstring, scan_fmt, variable) \
153+
logstring, log_fmt, scan_fmt, variable) \
152154
return_type variable; \
153155
{ \
154156
int err; \
@@ -158,11 +160,11 @@ PRAGMA_DIAG_POP
158160
scan_fmt, \
159161
&variable); \
160162
if (err != 0) { \
161-
log_trace(os, container)(logstring, (return_type) OSCONTAINER_ERROR); \
163+
log_trace(os, container)(logstring "%d", OSCONTAINER_ERROR); \
162164
return (return_type) OSCONTAINER_ERROR; \
163165
} \
164166
\
165-
log_trace(os, container)(logstring, variable); \
167+
log_trace(os, container)(logstring log_fmt, variable); \
166168
}
167169

168170
#define GET_CONTAINER_INFO_CPTR(return_type, subsystem, filename, \

src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void CgroupV1Controller::set_subsystem_path(char *cgroup_path) {
7676
*/
7777
jlong CgroupV1MemoryController::uses_mem_hierarchy() {
7878
GET_CONTAINER_INFO(jlong, this, "/memory.use_hierarchy",
79-
"Use Hierarchy is: " JLONG_FORMAT, JLONG_FORMAT, use_hierarchy);
79+
"Use Hierarchy is: ", JLONG_FORMAT, JLONG_FORMAT, use_hierarchy);
8080
return use_hierarchy;
8181
}
8282

@@ -90,7 +90,7 @@ void CgroupV1MemoryController::set_subsystem_path(char *cgroup_path) {
9090

9191
jlong CgroupV1Subsystem::read_memory_limit_in_bytes() {
9292
GET_CONTAINER_INFO(julong, _memory->controller(), "/memory.limit_in_bytes",
93-
"Memory Limit is: " JULONG_FORMAT, JULONG_FORMAT, memlimit);
93+
"Memory Limit is: ", JULONG_FORMAT, JULONG_FORMAT, memlimit);
9494

9595
if (memlimit >= os::Linux::physical_memory()) {
9696
log_trace(os, container)("Non-Hierarchical Memory Limit is: Unlimited");
@@ -116,7 +116,7 @@ jlong CgroupV1Subsystem::read_memory_limit_in_bytes() {
116116
jlong CgroupV1Subsystem::memory_and_swap_limit_in_bytes() {
117117
julong host_total_memsw;
118118
GET_CONTAINER_INFO(julong, _memory->controller(), "/memory.memsw.limit_in_bytes",
119-
"Memory and Swap Limit is: " JULONG_FORMAT, JULONG_FORMAT, memswlimit);
119+
"Memory and Swap Limit is: ", JULONG_FORMAT, JULONG_FORMAT, memswlimit);
120120
host_total_memsw = os::Linux::host_swap() + os::Linux::physical_memory();
121121
if (memswlimit >= host_total_memsw) {
122122
log_trace(os, container)("Non-Hierarchical Memory and Swap Limit is: Unlimited");
@@ -154,13 +154,13 @@ jlong CgroupV1Subsystem::memory_and_swap_limit_in_bytes() {
154154

155155
jlong CgroupV1Subsystem::read_mem_swappiness() {
156156
GET_CONTAINER_INFO(julong, _memory->controller(), "/memory.swappiness",
157-
"Swappiness is: " JULONG_FORMAT, JULONG_FORMAT, swappiness);
157+
"Swappiness is: ", JULONG_FORMAT, JULONG_FORMAT, swappiness);
158158
return swappiness;
159159
}
160160

161161
jlong CgroupV1Subsystem::memory_soft_limit_in_bytes() {
162162
GET_CONTAINER_INFO(julong, _memory->controller(), "/memory.soft_limit_in_bytes",
163-
"Memory Soft Limit is: " JULONG_FORMAT, JULONG_FORMAT, memsoftlimit);
163+
"Memory Soft Limit is: ", JULONG_FORMAT, JULONG_FORMAT, memsoftlimit);
164164
if (memsoftlimit >= os::Linux::physical_memory()) {
165165
log_trace(os, container)("Memory Soft Limit is: Unlimited");
166166
return (jlong)-1;
@@ -180,7 +180,7 @@ jlong CgroupV1Subsystem::memory_soft_limit_in_bytes() {
180180
*/
181181
jlong CgroupV1Subsystem::memory_usage_in_bytes() {
182182
GET_CONTAINER_INFO(jlong, _memory->controller(), "/memory.usage_in_bytes",
183-
"Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, memusage);
183+
"Memory Usage is: ", JLONG_FORMAT, JLONG_FORMAT, memusage);
184184
return memusage;
185185
}
186186

@@ -194,20 +194,20 @@ jlong CgroupV1Subsystem::memory_usage_in_bytes() {
194194
*/
195195
jlong CgroupV1Subsystem::memory_max_usage_in_bytes() {
196196
GET_CONTAINER_INFO(jlong, _memory->controller(), "/memory.max_usage_in_bytes",
197-
"Maximum Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, memmaxusage);
197+
"Maximum Memory Usage is: ", JLONG_FORMAT, JLONG_FORMAT, memmaxusage);
198198
return memmaxusage;
199199
}
200200

201201

202202
jlong CgroupV1Subsystem::kernel_memory_usage_in_bytes() {
203203
GET_CONTAINER_INFO(jlong, _memory->controller(), "/memory.kmem.usage_in_bytes",
204-
"Kernel Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, kmem_usage);
204+
"Kernel Memory Usage is: ", JLONG_FORMAT, JLONG_FORMAT, kmem_usage);
205205
return kmem_usage;
206206
}
207207

208208
jlong CgroupV1Subsystem::kernel_memory_limit_in_bytes() {
209209
GET_CONTAINER_INFO(julong, _memory->controller(), "/memory.kmem.limit_in_bytes",
210-
"Kernel Memory Limit is: " JULONG_FORMAT, JULONG_FORMAT, kmem_limit);
210+
"Kernel Memory Limit is: ", JULONG_FORMAT, JULONG_FORMAT, kmem_limit);
211211
if (kmem_limit >= os::Linux::physical_memory()) {
212212
return (jlong)-1;
213213
}
@@ -216,7 +216,7 @@ jlong CgroupV1Subsystem::kernel_memory_limit_in_bytes() {
216216

217217
jlong CgroupV1Subsystem::kernel_memory_max_usage_in_bytes() {
218218
GET_CONTAINER_INFO(jlong, _memory->controller(), "/memory.kmem.max_usage_in_bytes",
219-
"Maximum Kernel Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, kmem_max_usage);
219+
"Maximum Kernel Memory Usage is: ", JLONG_FORMAT, JLONG_FORMAT, kmem_max_usage);
220220
return kmem_max_usage;
221221
}
222222

@@ -254,13 +254,13 @@ char * CgroupV1Subsystem::cpu_cpuset_memory_nodes() {
254254
*/
255255
int CgroupV1Subsystem::cpu_quota() {
256256
GET_CONTAINER_INFO(int, _cpu->controller(), "/cpu.cfs_quota_us",
257-
"CPU Quota is: %d", "%d", quota);
257+
"CPU Quota is: ", "%d", "%d", quota);
258258
return quota;
259259
}
260260

261261
int CgroupV1Subsystem::cpu_period() {
262262
GET_CONTAINER_INFO(int, _cpu->controller(), "/cpu.cfs_period_us",
263-
"CPU Period is: %d", "%d", period);
263+
"CPU Period is: ", "%d", "%d", period);
264264
return period;
265265
}
266266

@@ -276,7 +276,7 @@ int CgroupV1Subsystem::cpu_period() {
276276
*/
277277
int CgroupV1Subsystem::cpu_shares() {
278278
GET_CONTAINER_INFO(int, _cpu->controller(), "/cpu.shares",
279-
"CPU Shares is: %d", "%d", shares);
279+
"CPU Shares is: ", "%d", "%d", shares);
280280
// Convert 1024 to no shares setup
281281
if (shares == 1024) return -1;
282282

@@ -316,6 +316,6 @@ jlong CgroupV1Subsystem::pids_max() {
316316
jlong CgroupV1Subsystem::pids_current() {
317317
if (_pids == NULL) return OSCONTAINER_ERROR;
318318
GET_CONTAINER_INFO(jlong, _pids, "/pids.current",
319-
"Current number of tasks is: " JLONG_FORMAT, JLONG_FORMAT, pids_current);
319+
"Current number of tasks is: ", JLONG_FORMAT, JLONG_FORMAT, pids_current);
320320
return pids_current;
321321
}

src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*/
3737
int CgroupV2Subsystem::cpu_shares() {
3838
GET_CONTAINER_INFO(int, _unified, "/cpu.weight",
39-
"Raw value for CPU Shares is: %d", "%d", shares);
39+
"Raw value for CPU Shares is: ", "%d", "%d", shares);
4040
// Convert default value of 100 to no shares setup
4141
if (shares == 100) {
4242
log_debug(os, container)("CPU Shares is: %d", -1);
@@ -109,7 +109,7 @@ char * CgroupV2Subsystem::cpu_cpuset_memory_nodes() {
109109

110110
int CgroupV2Subsystem::cpu_period() {
111111
GET_CONTAINER_INFO(int, _unified, "/cpu.max",
112-
"CPU Period is: %d", "%*s %d", period);
112+
"CPU Period is: ", "%d", "%*s %d", period);
113113
return period;
114114
}
115115

@@ -124,7 +124,7 @@ int CgroupV2Subsystem::cpu_period() {
124124
*/
125125
jlong CgroupV2Subsystem::memory_usage_in_bytes() {
126126
GET_CONTAINER_INFO(jlong, _unified, "/memory.current",
127-
"Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, memusage);
127+
"Memory Usage is: ", JLONG_FORMAT, JLONG_FORMAT, memusage);
128128
return memusage;
129129
}
130130

@@ -158,6 +158,7 @@ jlong CgroupV2Subsystem::memory_and_swap_limit_in_bytes() {
158158
assert(memory_limit >= 0, "swap limit without memory limit?");
159159
return memory_limit + swap_limit;
160160
}
161+
log_trace(os, container)("Memory and Swap Limit is: " JLONG_FORMAT, swap_limit);
161162
return swap_limit;
162163
}
163164

@@ -251,6 +252,6 @@ jlong CgroupV2Subsystem::pids_max() {
251252
*/
252253
jlong CgroupV2Subsystem::pids_current() {
253254
GET_CONTAINER_INFO(jlong, _unified, "/pids.current",
254-
"Current number of tasks is: " JLONG_FORMAT, JLONG_FORMAT, pids_current);
255+
"Current number of tasks is: ", JLONG_FORMAT, JLONG_FORMAT, pids_current);
255256
return pids_current;
256257
}

src/hotspot/share/code/nmethod.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class nmethod : public CompiledMethod {
256256
// stack. An not_entrant method can be removed when there are no
257257
// more activations, i.e., when the _stack_traversal_mark is less than
258258
// current sweep traversal index.
259-
volatile long _stack_traversal_mark;
259+
volatile int64_t _stack_traversal_mark;
260260

261261
// The _hotness_counter indicates the hotness of a method. The higher
262262
// the value the hotter the method. The hotness counter of a nmethod is
@@ -546,8 +546,8 @@ class nmethod : public CompiledMethod {
546546
void fix_oop_relocations() { fix_oop_relocations(NULL, NULL, false); }
547547

548548
// Sweeper support
549-
long stack_traversal_mark() { return _stack_traversal_mark; }
550-
void set_stack_traversal_mark(long l) { _stack_traversal_mark = l; }
549+
int64_t stack_traversal_mark() { return _stack_traversal_mark; }
550+
void set_stack_traversal_mark(int64_t l) { _stack_traversal_mark = l; }
551551

552552
// On-stack replacement support
553553
int osr_entry_bci() const { assert(is_osr_method(), "wrong kind of nmethod"); return _entry_bci; }

src/hotspot/share/compiler/compileBroker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int CompileBroker::_sum_standard_bytes_compiled = 0;
185185
int CompileBroker::_sum_nmethod_size = 0;
186186
int CompileBroker::_sum_nmethod_code_size = 0;
187187

188-
long CompileBroker::_peak_compilation_time = 0;
188+
jlong CompileBroker::_peak_compilation_time = 0;
189189

190190
CompilerStatistics CompileBroker::_stats_per_level[CompLevel_full_optimization];
191191

src/hotspot/share/compiler/compileBroker.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class CompileBroker: AllStatic {
223223
static int _sum_standard_bytes_compiled;
224224
static int _sum_nmethod_size;
225225
static int _sum_nmethod_code_size;
226-
static long _peak_compilation_time;
226+
static jlong _peak_compilation_time;
227227

228228
static CompilerStatistics _stats_per_level[];
229229

@@ -416,8 +416,8 @@ class CompileBroker: AllStatic {
416416
static int get_sum_standard_bytes_compiled() { return _sum_standard_bytes_compiled; }
417417
static int get_sum_nmethod_size() { return _sum_nmethod_size;}
418418
static int get_sum_nmethod_code_size() { return _sum_nmethod_code_size; }
419-
static long get_peak_compilation_time() { return _peak_compilation_time; }
420-
static long get_total_compilation_time() { return _t_total_compilation.milliseconds(); }
419+
static jlong get_peak_compilation_time() { return _peak_compilation_time; }
420+
static jlong get_total_compilation_time() { return _t_total_compilation.milliseconds(); }
421421

422422
// Log that compilation profiling is skipped because metaspace is full.
423423
static void log_metaspace_failure();

src/hotspot/share/jvmci/jvmciEnv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ void JVMCIEnv::put_int_at(JVMCIPrimitiveArray array, int index, jint value) {
569569
}
570570
}
571571

572-
long JVMCIEnv::get_long_at(JVMCIPrimitiveArray array, int index) {
572+
jlong JVMCIEnv::get_long_at(JVMCIPrimitiveArray array, int index) {
573573
if (is_hotspot()) {
574574
return HotSpotJVMCI::resolve(array)->long_at(index);
575575
} else {

src/hotspot/share/jvmci/jvmciEnv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class JVMCIEnv : public ResourceObj {
251251
jint get_int_at(JVMCIPrimitiveArray array, int index);
252252
void put_int_at(JVMCIPrimitiveArray array, int index, jint value);
253253

254-
long get_long_at(JVMCIPrimitiveArray array, int index);
254+
jlong get_long_at(JVMCIPrimitiveArray array, int index);
255255
void put_long_at(JVMCIPrimitiveArray array, int index, jlong value);
256256

257257
void copy_bytes_to(JVMCIPrimitiveArray src, jbyte* dest, int offset, jsize length);

src/hotspot/share/runtime/interfaceSupport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ VMNativeEntryWrapper::~VMNativeEntryWrapper() {
7878

7979
unsigned int InterfaceSupport::_scavenge_alot_counter = 1;
8080
unsigned int InterfaceSupport::_fullgc_alot_counter = 1;
81-
int InterfaceSupport::_fullgc_alot_invocation = 0;
81+
intx InterfaceSupport::_fullgc_alot_invocation = 0;
8282

8383
void InterfaceSupport::gc_alot() {
8484
Thread *thread = Thread::current();

src/hotspot/share/runtime/interfaceSupport.inline.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class InterfaceSupport: AllStatic {
5454
public:
5555
static unsigned int _scavenge_alot_counter;
5656
static unsigned int _fullgc_alot_counter;
57-
static int _fullgc_alot_invocation;
57+
static intx _fullgc_alot_invocation;
5858

5959
// Helper methods used to implement +ScavengeALot and +FullGCALot
6060
static void check_gc_alot() { if (ScavengeALot || FullGCALot) gc_alot(); }

0 commit comments

Comments
 (0)