RFR: 8332671: Logging for pretouching thread stacks shows wrong memory range [v2]

Aleksey Shipilev shade at openjdk.org
Thu May 23 09:59:03 UTC 2024


On Thu, 23 May 2024 04:30:15 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Trivial fix to a printout.
>> 
>> Before, looks like we only pretouch 32 bytes:
>> 
>> 
>> [2,417s][trace][os,thread] Pretouching thread stack from 0x00007f0f12640fe0 to 0x00007f0f12641000.          
>> 
>> 
>> Corrected with this patch:
>> 
>> 
>> [0,538s][trace][os,thread] Pretouching thread stack for 124618: [0x00007faa87f1afe0 - 0x00007faa87ffed90), (933296 bytes) (933296).
>
> Thomas Stuefe has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
> 
>  - Merge branch 'openjdk:master' into JDK-8332671-Logging-for-pretouching-thread-stacks-shows-wrong-memory-range
>  - JDK-8332671-Logging-for-pretouching-thread-stacks-shows-wrong-memory-range

Looks fine, with minor nits:

src/hotspot/share/runtime/javaThread.cpp line 2234:

> 2232:       char* p2 = (char*) alloca(to_alloc);
> 2233:       log_trace(os, thread)("Pretouching thread stack for " UINTX_FORMAT ": " RANGEFMT " (" SIZE_FORMAT ").",
> 2234:                             (uintx) osthread()->thread_id(), RANGEFMTARGS(p2, to_alloc), to_alloc);

Looks to me `RANGEFMTARGS` already prints the number of bytes in range, so printing `to_alloc` is excessive?

-------------

Marked as reviewed by shade (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19342#pullrequestreview-2073464883
PR Review Comment: https://git.openjdk.org/jdk/pull/19342#discussion_r1611378637


More information about the hotspot-runtime-dev mailing list