RFR: 8263718: unused-result warning happens at os_linux.cpp
hjl-tools
github.com+1072356+hjl-tools at openjdk.java.net
Fri Mar 19 19:53:42 UTC 2021
On Fri, 19 Mar 2021 17:51:08 GMT, Florian Weimer <fweimer at openjdk.org> wrote:
> The use of `getpid` in this code suggests it dates back to LinuxThreads, where the PID differed from thread to thread. On current Linux, `getpid` really returns the PID, so this does nothing to randomize the offset within a single process.
>
> I would expect the system thread library to do this if it is beneficial. glibc replaced `COLORING_INCREMENT` (similar to this `alloca`, I believe) with `MULTI_PAGE_ALIASING` on i386 around 2003. `MULTI_PAGE_ALIASING` is implemented in a completely different way; it tweaks stack sizes to avoid accidental higher-level alignment (above the page level) between different threads.
>
> @hjl-tools Do you think we need anything like this on current CPUs?
We don't need MULTI_PAGE_ALIASING anymore in glibc.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3042
More information about the hotspot-dev
mailing list