From c642f44bbe1e4cdbc23496a34ddaae30990ce7c0 Mon Sep 17 00:00:00 2001 From: Axel Boldt-Christmas Date: Wed, 15 May 2024 06:05:23 +0000 Subject: [PATCH] 8329839: Cleanup ZPhysicalMemoryBacking trace logging Reviewed-by: stefank, ayang --- src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp | 4 ++-- src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp | 4 ++-- .../os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp b/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp index bd1d7174c12..29825a9eab2 100644 --- a/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp +++ b/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp @@ -103,7 +103,7 @@ bool ZPhysicalMemoryBacking::commit_inner(zoffset offset, size_t length) const { assert(is_aligned(length, os::vm_page_size()), "Invalid length"); log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)", - untype(offset) / M, untype(offset) + length / M, length / M); + untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M); const uintptr_t addr = _base + untype(offset); 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 { assert(is_aligned(length, os::vm_page_size()), "Invalid length"); log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)", - untype(offset) / M, untype(offset) + length / M, length / M); + untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M); const uintptr_t start = _base + untype(offset); const void* const res = mmap((void*)start, length, PROT_NONE, MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE, -1, 0); diff --git a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp index ff891509365..76f9d90cd71 100644 --- a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp +++ b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp @@ -597,7 +597,7 @@ ZErrno ZPhysicalMemoryBacking::fallocate(bool punch_hole, zoffset offset, size_t bool ZPhysicalMemoryBacking::commit_inner(zoffset offset, size_t length) const { log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)", - untype(offset) / M, untype(offset + length) / M, length / M); + untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M); retry: const ZErrno err = fallocate(false /* punch_hole */, offset, length); @@ -697,7 +697,7 @@ size_t ZPhysicalMemoryBacking::commit(zoffset offset, size_t length) const { size_t ZPhysicalMemoryBacking::uncommit(zoffset offset, size_t length) const { log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)", - untype(offset) / M, untype(offset + length) / M, length / M); + untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M); const ZErrno err = fallocate(true /* punch_hole */, offset, length); if (err) { diff --git a/src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp b/src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp index 9a38352d1d7..181d0fada59 100644 --- a/src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp +++ b/src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp @@ -225,14 +225,14 @@ void ZPhysicalMemoryBacking::warn_commit_limits(size_t max_capacity) const { size_t ZPhysicalMemoryBacking::commit(zoffset offset, size_t length) { log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)", - untype(offset) / M, (untype(offset) + length) / M, length / M); + untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M); return _impl->commit(offset, length); } size_t ZPhysicalMemoryBacking::uncommit(zoffset offset, size_t length) { log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)", - untype(offset) / M, (untype(offset) + length) / M, length / M); + untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M); return _impl->uncommit(offset, length); }