Skip to content

Commit c642f44

Browse files
committed
8329839: Cleanup ZPhysicalMemoryBacking trace logging
Reviewed-by: stefank, ayang
1 parent d04ac14 commit c642f44

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ bool ZPhysicalMemoryBacking::commit_inner(zoffset offset, size_t length) const {
103103
assert(is_aligned(length, os::vm_page_size()), "Invalid length");
104104

105105
log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
106-
untype(offset) / M, untype(offset) + length / M, length / M);
106+
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
107107

108108
const uintptr_t addr = _base + untype(offset);
109109
const void* const res = mmap((void*)addr, length, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
@@ -150,7 +150,7 @@ size_t ZPhysicalMemoryBacking::uncommit(zoffset offset, size_t length) const {
150150
assert(is_aligned(length, os::vm_page_size()), "Invalid length");
151151

152152
log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
153-
untype(offset) / M, untype(offset) + length / M, length / M);
153+
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
154154

155155
const uintptr_t start = _base + untype(offset);
156156
const void* const res = mmap((void*)start, length, PROT_NONE, MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE, -1, 0);

src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ ZErrno ZPhysicalMemoryBacking::fallocate(bool punch_hole, zoffset offset, size_t
597597

598598
bool ZPhysicalMemoryBacking::commit_inner(zoffset offset, size_t length) const {
599599
log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
600-
untype(offset) / M, untype(offset + length) / M, length / M);
600+
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
601601

602602
retry:
603603
const ZErrno err = fallocate(false /* punch_hole */, offset, length);
@@ -697,7 +697,7 @@ size_t ZPhysicalMemoryBacking::commit(zoffset offset, size_t length) const {
697697

698698
size_t ZPhysicalMemoryBacking::uncommit(zoffset offset, size_t length) const {
699699
log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
700-
untype(offset) / M, untype(offset + length) / M, length / M);
700+
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
701701

702702
const ZErrno err = fallocate(true /* punch_hole */, offset, length);
703703
if (err) {

src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ void ZPhysicalMemoryBacking::warn_commit_limits(size_t max_capacity) const {
225225

226226
size_t ZPhysicalMemoryBacking::commit(zoffset offset, size_t length) {
227227
log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
228-
untype(offset) / M, (untype(offset) + length) / M, length / M);
228+
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
229229

230230
return _impl->commit(offset, length);
231231
}
232232

233233
size_t ZPhysicalMemoryBacking::uncommit(zoffset offset, size_t length) {
234234
log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
235-
untype(offset) / M, (untype(offset) + length) / M, length / M);
235+
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
236236

237237
return _impl->uncommit(offset, length);
238238
}

0 commit comments

Comments
 (0)