Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change heuristics for activating compilation threads #3139

Merged
merged 1 commit into from
Oct 5, 2018

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Oct 4, 2018

Currently the logic for activating compilation threads does not work as
intended when the number of compilation threads is specified by the user.
Ideally, when the user sets the number of compilation threads with
-XcompilationThreads<n> option, the JVM should activate new threads up to
'n' based on its internal activation thresholds. However, currently the JIT
will activate only (numProc-1) compilation threads (regardless of how many
the user specified) and the extra compilation threads could be activated
only if 'starvation' of the compilation threads is detected.

This commit will change the logic as follows:

  1. If the user specifies the number of compilation threads the JIT will
    assume that the user knows best and will activate the compilation threads
    based on its internal activation threasholds irrespective of the number
    of CPUs the JVM is allowed to run on.

  2. If the user does not specify the number of compilation threads, the JVM
    will activate up to numProc-1 compilation threads based on its internal
    activation thresholds. Moreover, if more compilation threads are present
    and starvation of compilation is detected (this could happen in linux)
    then the additional existent compilation threads are activated based on
    a more conservative activation policy.

Signed-off-by: Marius Pirvu mpirvu@ca.ibm.com

Currently the logic for activating compilation threads does not work as
intended when the number of compilation threads is specified by the user.
Ideally, when the user sets the number of compilation threads with
`-XcompilationThreads<n>` option, the JVM should activate new threads up to
'n' based on its internal activation thresholds. However, currently the JIT
will activate only (numProc-1) compilation threads (regardless of how many
the user specified) and the extra compilation threads could be activated
only if 'starvation' of the compilation threads is detected.

This commit will change the logic as follows:
1) If the user specifies the number of compilation threads the JIT will
assume that the user knows best and will activate the compilation threads
based on its internal activation threasholds irrespective of the number
of CPUs the JVM is allowed to run on.

2) If the user does not specify the number of compilation threads, the JVM
will activate up to numProc-1 compilation threads based on its internal
activation thresholds. Moreover, if more compilation threads are present
and starvation of compilation is detected (this could happen in linux)
then the additional existent compilation threads are activated based on
a more conservative activation policy.

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
@mpirvu mpirvu added the comp:jit label Oct 4, 2018
@mpirvu mpirvu requested a review from ymanton October 4, 2018 14:06
@ymanton
Copy link
Member

ymanton commented Oct 4, 2018

LGTM.

Jenkins test sanity all jdk8

@ymanton
Copy link
Member

ymanton commented Oct 4, 2018

Jenkins copyright check
Jenkins line endings check

@AdamBrousseau
Copy link
Contributor

Jenkins copyright check

@AdamBrousseau
Copy link
Contributor

Jenkins line endings check

@mpirvu
Copy link
Contributor Author

mpirvu commented Oct 5, 2018

The two test failures on Windows are due to infra problems.

@ymanton ymanton merged commit 1b800b0 into eclipse-openj9:master Oct 5, 2018
@mpirvu mpirvu deleted the newactivpolicy branch November 27, 2019 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants