RFR: 8323807: Async UL: Add a stalling mode to async UL [v2]

Thomas Stuefe stuefe at openjdk.org
Thu Apr 11 06:52:45 UTC 2024


On Tue, 2 Apr 2024 08:09:42 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> src/hotspot/share/logging/circularStringBuffer.cpp line 35:
>> 
>>> 33: const char* allocation_failure_msg = "Failed to allocate async logging buffer";
>>> 34: 
>>> 35: #ifdef LINUX
>> 
>> Why do we want/need a specialized version for Linux?
>
> It's an optimization. We perform a different memory mapping on Linux (described in header), this allows for describing the API operations as a single `memcpy`. The other platforms require two. This has been observed to have tangible perf benefits in the past (see [0]). The other OS:s also supports this kind of memory mapping, but I wanted to scale the PR back in size and dev. effort so I focused on Linux.
> 
> [0] https://lo.calho.st/posts/black-magic-buffer/   `slow: 0.012196 microseconds per write
> fast: 0.004024 microseconds per write`

Interesting idea, but before going down that road and use double mapping I would really like to understand whether the performance matters in practice. 

I also doubt the article's numbers. They claim a speed increase of >4x from using two memcpy compared  to a single memcpy. That is a lot.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17757#discussion_r1560510629


More information about the hotspot-runtime-dev mailing list