From 688b0ef624bbac8264367bfba912e41981b8bbc5 Mon Sep 17 00:00:00 2001 From: Sara Hamouda Date: Sat, 24 Jun 2023 14:15:35 +0000 Subject: [PATCH 1/3] Replace hardcoded debug level "release" with $DEBUG_LEVEL so that the instructions are correct when users choose a differnt debug level. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6e5c071e..b3649aec 100644 --- a/README.md +++ b/README.md @@ -121,10 +121,10 @@ The output jdk is at `./build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk`. **Note:** The above `make` command will build what is known as the [`default` target or "exploded image"](https://github.com/openjdk/jdk11u/blob/master/doc/building.md#Running-make). This build is exclusively meant for developers who want quick and incremental builds to test changes. If you are planning on evaluating your build (be it performance, minimum heap, etc.), then it is *highly advised* to use the `images` target. The `default` target is the (roughly) minimal set of outputs required to run the built JDK and is not guaranteed to run all benchmarks. It may have bloated minimum heap values as well. The `images` target can be built like so: ```console -$ make CONF=linux-x86_64-normal-server-release THIRD_PARTY_HEAP=$PWD/../mmtk-openjdk/openjdk images +$ make CONF=linux-x86_64-normal-server-$DEBUG_LEVEL THIRD_PARTY_HEAP=$PWD/../mmtk-openjdk/openjdk images ``` -The output jdk is then found at `./build/linux-x86_64-normal-server-release/images/jdk`. +The output jdk is then found at `./build/linux-x86_64-normal-server-$DEBUG_LEVEL/images/jdk`. ### Profile-Guided Optimized Build @@ -148,7 +148,7 @@ stress factor of 4 MB in order to trigger more GC events. First we compile MMTk with profiling support: ```console -$ RUSTFLAGS="-Cprofile-generate=/tmp/$USER/pgo-data" make CONF=linux-x86_64-normal-server-release THIRD_PARTY_HEAP=$PWD/../mmtk-openjdk/openjdk images +$ RUSTFLAGS="-Cprofile-generate=/tmp/$USER/pgo-data" make CONF=linux-x86_64-normal-server-$DEBUG_LEVEL THIRD_PARTY_HEAP=$PWD/../mmtk-openjdk/openjdk images $ rm -rf /tmp/$USER/pgo-data/* ``` We clear the `/tmp/$USER/pgo-data` directory as during compilation, the JVM we @@ -159,7 +159,7 @@ We then run `fop` in order to get some profiling data. Note that your location for the DaCapo benchmarks may be different: ```bash -MMTK_PLAN=GenImmix MMTK_STRESS_FACTOR=4194304 MMTK_PRECISE_STRESS=false ./build/linux-x86_64-normal-server-release/images/jdk/bin/java -XX:MetaspaceSize=500M -XX:+DisableExplicitGC -XX:-TieredCompilation -Xcomp -XX:+UseThirdPartyHeap -Xms60M -Xmx60M -jar /usr/share/benchmarks/dacapo/dacapo-evaluation-git-6e411f33.jar -n 5 fop +MMTK_PLAN=GenImmix MMTK_STRESS_FACTOR=4194304 MMTK_PRECISE_STRESS=false ./build/linux-x86_64-normal-server-$DEBUG_LEVEL/images/jdk/bin/java -XX:MetaspaceSize=500M -XX:+DisableExplicitGC -XX:-TieredCompilation -Xcomp -XX:+UseThirdPartyHeap -Xms60M -Xmx60M -jar /usr/share/benchmarks/dacapo/dacapo-evaluation-git-6e411f33.jar -n 5 fop ``` We have to merge the profiling data into something we can feed into the Rust @@ -176,11 +176,11 @@ your Rust version.* Finally, we build a new image using the profiling data as an input: ```console -$ RUSTFLAGS="-Cprofile-use=/tmp/$USER/pgo-data/merged.profdata -Cllvm-args=-pgo-warn-missing-function" make CONF=linux-x86_64-normal-server-release THIRD_PARTY_HEAP=$PWD/../mmtk-openjdk/openjdk images +$ RUSTFLAGS="-Cprofile-use=/tmp/$USER/pgo-data/merged.profdata -Cllvm-args=-pgo-warn-missing-function" make CONF=linux-x86_64-normal-server-$DEBUG_LEVEL THIRD_PARTY_HEAP=$PWD/../mmtk-openjdk/openjdk images ``` We now have an OpenJDK build under -`./build/linux-x86_64-normal-server-release/images/jdk` with MMTk that has been +`./build/linux-x86_64-normal-server-$DEBUG_LEVEL/images/jdk` with MMTk that has been optimized using PGO. For ease of use, we have provided an example script which does the above in From 47b560d5b53dd8b755eb290a379fbc29ac6fab9b Mon Sep 17 00:00:00 2001 From: Sara Hamouda Date: Sat, 24 Jun 2023 14:25:38 +0000 Subject: [PATCH 2/3] Remove reference to legacy "repos" directory in Cargo.toml to make mmtk dependency value (even if commented) consistent with the default directory structure in README.md --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 29e28a66..a1eb50fe 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -32,7 +32,7 @@ once_cell = "1.10.0" # But other changes including adding/removing whitespaces in commented lines may break the CI. mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "f1a0bb7fbec97dd84e35a40e8be01cf5018f2f9e" } # Uncomment the following to build locally -# mmtk = { path = "../repos/mmtk-core" } +# mmtk = { path = "../../mmtk-core" } [build-dependencies] built = { version = "0.5.1", features = ["git2"] } From 957e7657f79a984c16cc0d69df5c8edbe2645ba4 Mon Sep 17 00:00:00 2001 From: Sara Hamouda Date: Mon, 26 Jun 2023 04:00:30 +0000 Subject: [PATCH 3/3] Restore the hardcoded "release" target for performance runs with the images target As per k-sareen's review, users are expected to use the release mode for performance evaluations. So using a hardcoded debug mode here is OK. Updated the note text to clarify that. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b3649aec..7220611d 100644 --- a/README.md +++ b/README.md @@ -118,13 +118,13 @@ $ make CONF=linux-x86_64-normal-server-$DEBUG_LEVEL THIRD_PARTY_HEAP=$PWD/../mmt The output jdk is at `./build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk`. -**Note:** The above `make` command will build what is known as the [`default` target or "exploded image"](https://github.com/openjdk/jdk11u/blob/master/doc/building.md#Running-make). This build is exclusively meant for developers who want quick and incremental builds to test changes. If you are planning on evaluating your build (be it performance, minimum heap, etc.), then it is *highly advised* to use the `images` target. The `default` target is the (roughly) minimal set of outputs required to run the built JDK and is not guaranteed to run all benchmarks. It may have bloated minimum heap values as well. The `images` target can be built like so: +**Note:** The above `make` command will build what is known as the [`default` target or "exploded image"](https://github.com/openjdk/jdk11u/blob/master/doc/building.md#Running-make). This build is exclusively meant for developers who want quick and incremental builds to test changes. If you are planning on evaluating your build (be it performance, minimum heap, etc.), then it is *highly advised* to use the `release` debug level with the `images` target. The `default` target is the (roughly) minimal set of outputs required to run the built JDK and is not guaranteed to run all benchmarks. It may have bloated minimum heap values as well. The `images` target can be built like so: ```console -$ make CONF=linux-x86_64-normal-server-$DEBUG_LEVEL THIRD_PARTY_HEAP=$PWD/../mmtk-openjdk/openjdk images +$ make CONF=linux-x86_64-normal-server-release THIRD_PARTY_HEAP=$PWD/../mmtk-openjdk/openjdk images ``` -The output jdk is then found at `./build/linux-x86_64-normal-server-$DEBUG_LEVEL/images/jdk`. +The output jdk is then found at `./build/linux-x86_64-normal-server-release/images/jdk`. ### Profile-Guided Optimized Build