-
Notifications
You must be signed in to change notification settings - Fork 736
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 jvmtiGetAvailableProcessors to use J9PORT_CPU_TARGET #2255
Change jvmtiGetAvailableProcessors to use J9PORT_CPU_TARGET #2255
Conversation
Can you add a comment to both this method and to the JVM_ function to say the two implementations should be kept consistent? |
37de50d
to
b80ef11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the comment.
runtime/jvmti/jvmtiTimers.c
Outdated
@@ -208,7 +208,8 @@ jvmtiGetAvailableProcessors(jvmtiEnv* env, | |||
|
|||
ENSURE_NON_NULL(processor_count_ptr); | |||
|
|||
cpuCount = j9sysinfo_get_number_CPUs_by_type(J9PORT_CPU_ONLINE); | |||
/* This implementation should be kept consistent with JVM_ActiveProcessorCount */ | |||
cpuCount = j9sysinfo_get_number_CPUs_by_type(J9PORT_CPU_TARGET); | |||
*processor_count_ptr = ((cpuCount == 0) ? 1 : (jint) cpuCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the two consistent, can you modify the ((cpuCount == 0)
to be ((cpuCount < 1)
This change causes `jvmtiGetAvailableProcessors` to behave identically to `JVM_ActiveProcessorCount`, also taking into account cgroup limits when appropriate as discussed in eclipse-openj9#1166. Signed-off-by: Mohammad Ali Nikseresht <anikser@ibm.com>
b80ef11
to
e876642
Compare
Jenkins test sanity plinux jdk8 |
travis build failed for infra issues contacting sourceforge. |
This change causes
jvmtiGetAvailableProcessors
to behave identicallyto
JVM_ActiveProcessorCount
, also taking into account cgroup limitswhen appropriate as discussed in #1166.
Signed-off-by: Mohammad Ali Nikseresht anikser@ibm.com