RFR: 8313306: More sensible reservation logging [v2]

David Holmes dholmes at openjdk.org
Mon Jan 29 02:21:32 UTC 2024


On Mon, 29 Jan 2024 02:04:28 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/os/aix/os_aix.cpp line 300:
>> 
>>> 298:     if (::disclaim(p, maxDisclaimSize, DISCLAIM_ZEROMEM) != 0) {
>>> 299:       ErrnoPreserver ep;
>>> 300:       log_trace(os,map)("Cannot disclaim %p - %p (errno %d)\n", p, p + maxDisclaimSize, errno);
>> 
>> Using `os::strerror` or `os::errno_name` would be more user friendly than printing the numeric value. Don't simply replicate the crude approach of `trcVerbose`. This applies everywhere `errno` is being printed.
>
> Also isn't the whole point of using the preserver to allow you capture errno and read it back from the preserver without caring if something in the logging code changed it in the meantime?

i.e rather than passing `errno` as a parameter, you should be passing `ep.errno()`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17356#discussion_r1469013028


More information about the hotspot-runtime-dev mailing list