Skip to content

Commit

Permalink
8329839: Cleanup ZPhysicalMemoryBacking trace logging
Browse files Browse the repository at this point in the history
Reviewed-by: stefank, ayang
  • Loading branch information
xmas92 committed May 15, 2024
1 parent d04ac14 commit c642f44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

1 comment on commit c642f44

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.