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

[Warning] of online processor count #37

Closed
hz0ne opened this issue Jul 10, 2019 · 5 comments
Closed

[Warning] of online processor count #37

hz0ne opened this issue Jul 10, 2019 · 5 comments

Comments

@hz0ne
Copy link

hz0ne commented Jul 10, 2019

Description
The testing device is kunlun-9032 with 1024 processors, when I run java program it will report the warning:
OpenJDK 64-Bit Server VM warning: sched_getaffinity failed (Invalid argument)- using online processor count (1024) which may exceed available processors

Expected behavior
the warning may also can reproduce on other jdk versions, but it may not fixed on redhat version, it should be fixed.
seen: https://bugs.openjdk.java.net/browse/JDK-8157478

JDK version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (Alibaba Dragonwell 8.0.0-b48) (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (Alibaba Dragonwell 8.0.0-b48) (build 25.212-b04, mixed mode)

Execution environment

  • OS and version: redhat 7.2
  • Number of CPU cores: 1024
  • Inside Linux container? No
@luchsh
Copy link
Contributor

luchsh commented Jul 16, 2019

Hi dhxsy1994, thanks for reporting!
Unfortunately, I cannot find a powerful machine like yours to reproduce this case.
the warning was produced by this code.
As I read from the code and Linux manual (man 3 CPU_SET), the maximum number of processors currently supported by CPU affinity is 1024 (CPU_SETSIZE). Are you suggesting that something is wrong with handling the 1024th core?

@hz0ne
Copy link
Author

hz0ne commented Jul 21, 2019

The range of cpu number is 0~1023, sched_getaffinity() may not work with the 1024th cpu, this processor is not online. Maybe this warning is not important, many versions have this warning with my test. Thanks!

@luchsh
Copy link
Contributor

luchsh commented Jul 23, 2019

The range of cpu number is 0~1023, sched_getaffinity() may not work with the 1024th cpu, this processor is not online. Maybe this warning is not important, many versions have this warning with my test. Thanks!

Indeed, Dragonwell does not ship any processors related patches in the GA release, it's behavior ought to exactly the same as the reference implementation. I was just trying to figure out whether sched_getaffinity() and JDK's behavior was correct about the 1024th (id=1024) cpu.
If it looks like incorrect behavior, maybe we should raise a bug to upstream OpenJDK.

@luchsh
Copy link
Contributor

luchsh commented Aug 2, 2019

I'm closing this issue, since it sounds like a problem upstream OpenJDK also has, please re-open if you feel that we should do something in Dragonwell.
Thanks

@luchsh luchsh closed this as completed Aug 2, 2019
@ErichLoew
Copy link

The topic is back:
My CPU: Intel(R) Core(TM)2 Duo CPU E8400
Kernel: 6.1.1
OS: OpenSUSE Leap 15.2
java: java 19 2022-09-20
Java (TM) SE Runtime Environment (build 19+36-2238)
Java HotSpot(TM) 64-Bit Server VM (build 19+36-2238, mixed
mode, sharing)

Since kernel 6.1.0 I see: Java HotSpot(TM) 64-Bit Server VM warning: sched_getaffinity failed (Invalid argument)- using online processor count (2) which may exceed available processors

On kernel 6.0.12 and older: issue not observable

I jumped directly from 6.0.12 to 6.1.0 and then to 6.1.1

My interpretation: something in recent kernel interfaces to USER world irritates JAVA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants