RFR: 8341334: CDS: Parallel relocation [v8]
Aleksey Shipilev
shade at openjdk.org
Wed Nov 6 11:26:44 UTC 2024
> In Leyden performance investigations, we have figured that `ArchiveRelocationMode=0` is saving 5..7 ms on HelloWorld startup. Mainline defaults to `ARM=1`, _losing_ as much. `ARM=0` was switched to `ARM=1` with [JDK-8294323](https://github.com/openjdk/jdk/commit/be70bc1c58eaec876aa1ab36eacba90b901ac9b8), which was delivered to JDK 17+ in in Apr 2023.
>
> Profiling shows we spend time mem-faulting the memory loading the RO/RW regions, about 15 MB total. 15 MB in 5ms amounts to >4GB/sec, close to the single-threaded limits. I suspect the impact is larger if we relocate larger Metaspace, e.g. after dumping a CDS archive from a large application. There is little we can do to make the actual relocation part faster: the overwhelming majority of samples is on kernel side.
>
> This PR implements the infrastructure for fast archive workers, and leverages it to perform parallel core regions relocation. The RW/RO regions this code traverses is large, and we can squeeze more performance by parallelizing it. Without pretouch from (1), this step serves as one for RW/RO regions.
>
> (I'll put some performance data in the comments to show how these interact)
>
> Additional testing:
> - [x] Linux x86_64 server fastdebug, `runtime/cds`
> - [x] Linux AArch64 server fastdebug, `all`
Aleksey Shipilev has updated the pull request incrementally with four additional commits since the last revision:
- More conservative/eager worker count selection logic
- Avalanche signaling as well
- Worker fence is misplaced
- Rename the flag
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/21302/files
- new: https://git.openjdk.org/jdk/pull/21302/files/d4d739b1..0a92f8ed
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=21302&range=07
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=21302&range=06-07
Stats: 51 lines in 4 files changed: 34 ins; 12 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/21302.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21302/head:pull/21302
PR: https://git.openjdk.org/jdk/pull/21302
More information about the hotspot-runtime-dev
mailing list